Roland Turner

about | contact

Making “top” watch instances of a particular command

top -p $(ps --no-headers -o pid -C exim | head -20 | paste -s -d ,)

UPDATE 2008-08-10: Used explicit HTML entities to work around WordPress’s “improvements”. Added ” head -20″ to deal with top’s limit on the number of PIDs that it will track.