Skip to content

Instantly share code, notes, and snippets.

@msukmanowsky
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save msukmanowsky/37fe05001d7f30c0f2a0 to your computer and use it in GitHub Desktop.

Select an option

Save msukmanowsky/37fe05001d7f30c0f2a0 to your computer and use it in GitHub Desktop.

Basics

Sort the output of a command

By 3rd column (1-indexed) in reverse order

sort -k3 -r
$ sudo netstat -tlupe --numeric-ports | grep storm | sort -k3 -r
tcp6       0      0 :::8081                 :::*                    LISTEN      storm      15476       2500/java
tcp6       0      0 :::6627                 :::*                    LISTEN      storm      13305       2505/java
tcp6       0      0 :::4000                 :::*                    LISTEN      storm      15450       2493/java
tcp6       0      0 :::36263                :::*                    LISTEN      storm      13266       2493/java
tcp6       0      0 :::17060                :::*                    LISTEN      storm      15449       2493/java

Networking

Programs listening on ports

sudo netstat -tlupe --numeric-ports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment