My Favourite Grep / Bash Combo’s
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.
About this entry
You’re currently reading “My Favourite Grep / Bash Combo’s,” an entry on opensourcetutor.com
- Published:
- 19.02.07 / 1pm
- Category:
- Linux Administration
- Tags:
- No Tags
- Related Posts:
- No Related Posts
No comments
Jump to comment form | comments rss [?] | trackback uri [?]