Monday, June 17, 2013

unix top to see specific command details

Using pgrep to get pid's of matching command lines:
 
$> top -c -p $(pgrep -d',' -f string_to_match_in_cmd_line)
 
top -p expects a comma separated list of pids so we use -d',' in pgrep. 
The -f flag in pgrep makes it match the command line instead of program name. 

No comments:

Post a Comment