|
netstat -atnup
|
My all time classic, see below for details.
|
|
netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i < $1; i++) {printf("*")}; print "" }'
|
Graph the number of connections for each host
|
|
tailf <file>
|
Output the last 10 lines of a file
|
|
tailf -n 5 <file>
|
Output the last 5 lines of a file
|
tail -f /var/log/tomcat/foobar.log -f /var/log/catalina.out
|
df -h
|
Show filesystem usage in human-friendly format
|
|
df -i
|
Show inode usage
|
|
df -l
|
List only local filesystems (don't list NFS or SAMBA mounts)
|
|
iostat -x 5
|
Display full statistics for every filesystem, refresh every 5 seconds
|
|
top
|
Display Linux tasks
|
|
top -p $(pgrep -d , foobar)
|
Monitor processes with the same name fragment 'foobar'
|
|
ps -ef
|
See every process on the system
|
|
ps -ejH
|
Print a process tree
|
|
ps -eLf
|
Get info about threads
|
|
ps -C java -o pid=
|
Print only the process IDs of apache tomcat
|
|
ps -o nlwp <PID>
|
Show the threads (Light Weight Processes) associated to a PID.
|
|
Ctrl + a
|
Jump to the beginning of the line ()
|
|
Ctrl + e
|
Jump to the end of the line ()
|
|
Ctrl + l
|
Clears the screen
|
|
Ctrl + r
|
Lookup a command in history
|
|
Alt + .
|
Recalls last argument.
|
I received a syntax error when run this: netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i < $1; i++) {printf("*")}; print "" }'
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.