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
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
When bootstrapping or repairing a node this is a simple way to keep tabs on what a node is actively doing. 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)
This can be added to ~/.bashrc with your other shell aliases. Emulates similar look & feel to ping6 & traceroute6. Show Sample Output
Check the connection of the maximum number of IP Show Sample Output
Can be used to discover what programms create internet traffic. Skip the part after awk to get more details. Has anyone an idea why the uniq doesn't work propperly here (see sample output)? Show Sample Output
Tested on CentOS, Ubuntu, and MacOS.
Monitoring TCP connections number showing each state. It uses ss instead of netstat because it's much faster with high trafic. You can fgrep specific ports by piping right before awk: watch "ss -nat | fgrep :80 | awk '"'{print $1}'"' | sort | uniq -c" Show Sample Output
Open Port Check
Output contains also garbage (text parts from netstat's output) but it's good enough for quick check who's overloading your server.
Useful to check DDoS attacks on servers. Show Sample Output
Shows you all listening tcp/udp ports, and what program has them open(depending on rights)
netstat has two lines of headers: Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State Added a filter in the awk command to remove them
Ok so it's rellay useless line and I sorry for that, furthermore that's nothing optimized at all... At the beginning I didn't managed by using netstat -p to print out which process was handling that open port 4444, I realize at the end I was not root and security restrictions applied ;p It's nevertheless a (good ?) way to see how ps(tree) works, as it acts exactly the same way by reading in /proc So for a specific port, this line returns the calling command line of every thread that handle the associated socket
Just find out the daemon with $ netstat -atulpe. Then type in his name and he gets the SIGTERM.
Affiche des infos detaillees sur vos connexions reseaux. Port en ?coute, protocole, paquets, adresses, ustilisateur, PID etc...
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: