A Unix Utility to Know About: lsof (2009)
31–40 of 54 posts
Re: A Unix Utility to Know About: lsof (2009)
#32Re: A Unix Utility to Know About: lsof (2009)
#33Earlier quoted context omitted.
I am more a `killall ` guy.
Sometimes, I want something a little more murderous, so I tend to write this script on most systems I use: ps -ef | grep $1 | awk '{print "kill -9 " $2}' | sh Usually stored as /usr/local/bin/kll I've found it's very useful for killing specific Java programs without having to killall -9 java. (and, yeah, I should probably be using ps -efww instead of ps -ef, but old habits die hard... I've already got ps aliased to p…
Re: A Unix Utility to Know About: lsof (2009)
#34`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
I am guilty of using `ps|aux` for the sole purpose of answering this question: Is it (still) running ? edit: `ps aux|grep`, indeed. Silly me in the early hours of a rest day :).
Re: A Unix Utility to Know About: lsof (2009)
#35Earlier quoted context omitted.
I am guilty of using `ps|aux` for the sole purpose of answering this question: Is it (still) running ? edit: `ps aux|grep`, indeed. Silly me in the early hours of a rest day :).
>> I am guilty of using `ps|aux` What's wrong with doing that? I've been doing that for so long I don't know why I do it
ps -C procname
ps -p pid
ps -u username
ps -t ttyname
ps -f [-w [-w]]
ps -o output-formatRe: A Unix Utility to Know About: lsof (2009)
#36That together with a dump of active iptables rules normally results in an immediate fix for 90% of "why can't I connect to X" problems :)
Re: A Unix Utility to Know About: lsof (2009)
#37Earlier quoted context omitted.
I am guilty of using `ps|aux` for the sole purpose of answering this question: Is it (still) running ? edit: `ps aux|grep`, indeed. Silly me in the early hours of a rest day :).
Modern Linuxes have pgrep to help avoid the inevitable "lol, the grep process I fired will match" issue that results in having to filter that out as well with yet another program.
Re: A Unix Utility to Know About: lsof (2009)
#38`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
Sometimes powerful tools require effort to understand. Lsof is absolutely something you should spend some real time grokking. In regard to ps you can memorize a few commands until something truly weird comes up since you will probably use other more specialized snapshotting and tracing tools for anything somewhat difficult to troubleshoot.
Re: A Unix Utility to Know About: lsof (2009)
#39Earlier quoted context omitted.
For interactive use, I strongly recommend htop if you're still doing stuff like "ps aux | grep" and then "kill 84728". Htop is top on steroids: ncurses-based and very fast, has colors, threaded or flat process view, sorting by different criteria like cpu or ram use, searching for substring match in process name, interface to killing/signalling to selected process, etc. http://hisham.hm/htop/
I am more a `killall ` guy.
Re: A Unix Utility to Know About: lsof (2009)
#40Earlier quoted context omitted.
You mean `ps aux | grep` which I am also guilty of using every time ? You might be interested in pgrep ( http://linux.die.net/man/1/pgrep ) as well.
For interactive use, I strongly recommend htop if you're still doing stuff like "ps aux | grep" and then "kill 84728". Htop is top on steroids: ncurses-based and very fast, has colors, threaded or flat process view, sorting by different criteria like cpu or ram use, searching for substring match in process name, interface to killing/signalling to selected process, etc. http://hisham.hm/htop/