2010/09/24

Tools

This is a short list of commands and idioms that make life at the command prompt bearable. Some of them are trivial, but if you don't know they are there, you'll never find them. Reading their man pages is recommended.
screen

perl -lane 'short script'
find [....] -print0 | xargs -0 cmd
( set -e ; cmd1; cmd2; cmd3 ) && killall some-daemon
pstree
ps -C cmd
lsof -c cmd
ssh-keygen
pidof
chkconfig
$(( arithmetic ))
${var/match/replace}
lshw
for n in [...] ; do cmd $n ; done
some-command | grep | while read n ; do cmd $n ; done

lshw combines lspci, lsusb, lshal, lspcmcia and more. Forgot what motherboard a server has? lshw knows. What size/manufacture/number of DIMMs you installed? lshw knows. What version of BIOS? lshw might know. Under CentOS you have to get it from RPMForge.

One should learn variable expansion syntax if one spend any time with bash.

And yes, I do type while and for loops at the command line.

No comments: