This is also perl-less, and only uses AWK as its postprocessor. Tested with GAWK and MAWK.
Show state of NAT, readed from '/proc/net/ip_conntrack' or '/proc/net/nf_conntrack' Show Sample Output
cut -f1,2 - IP range 16 cut -f1,2,3 - IP range 24 cut -f1,2,3,4 - IP range 24 Show Sample Output
Count on a specific port (80) - FreeBSD friendly. Show Sample Output
I used this to get all the remote connection ip addresses connected to my server... I had to start storing and tracking this data so thats why i built this out... probably not optimal as far as the egrep regex but it works ;) Show Sample Output
This has saved me many times while debugging timeout issues to "too many open files" issues. A high number of the order of thousand, indicates that somewhere connection is not being closed properly. Show Sample Output
bit of a contrived example and playing to my OCD but nice for quick scripted output of listening ports which is sorted by port, ip address and protocol. Show Sample Output
Should work with sh, bash, etc. Show Sample Output
Doesn't list connections to other ports than port 80. Not f.e. 8080 or 8091. Excludes programs listening for connections, like your favorite webserver.
netstat will list all open ports on the system, unix sockets, tcp sockets and udp sockets. the t flag limits to tcp ports the l flag limits to listening ports and the n flag disables the translation of port to service ( ie :25 displayed instead of :smtp ). then grep for the port you are interested in preceeded by a colon. Show Sample Output
-t TCP -u UDP -n NO DNS resolution or PORT/SERVICE resolution -l state -a ? -p PORT show -o flag (keepalive, off, etc)
Show If Someone Is Connected To The Android Device On And Get Their IP Address
Useful to see what ports are taken by running services. Show Sample Output
This can be added to ~/.bashrc with your other shell aliases. Emulates similar look & feel to ping6 & traceroute6. Show Sample Output
Order and uniq
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: