Just a quick build up of my most commonly used bash commands
lsof | grep ‘searchterm’ – List open files and search for specific handle
history | grep ‘searchterm’ – Search for a term in my bash history (I now have this setup as an alias ‘ghistory’
ps -ef | grep ‘process’ – Much the same as ‘ps aux | grep’ but is HP-UX compatible, so force of habit really.
!ssh – Reuse the last ssh command in history (make sure you never use !rm, especially if you ever use rm -rf).
netstat -anp | grep ‘searchterm’ – Great for finding which processes are talking on which ports and to which ip addresses.
That’s it for the moment, I’ll keep them coming shortly.