How do you use
top with just showing the CMD name?
I have used
top with just showing the running process that I want; for example:
$ top -p 19745
And if I want more than one PID, I would use:
$ top -p 19745 -p 19746 -p 19747
I have Googled it, but they don't say how you can do it, even when I try looking at the help in
top it still doesn't show you.
Is there a way you can filter by the CMD name only?
There are certain files that I am running through Apache2, and I want to monitor them only.
afile1.abc afile2.abc afile3.abc afile4.abc
I see this in the
man top page:
x: Command -- Command line or Program name Display the command line used to start a task or the name of the associated program. You toggle between command line and name with 'c', which is both a command-line option and an interactive command. When you've chosen to display command lines, processes without a command line (like kernel threads) will be shown with only the program name in parentheses, as in this example: ( mdrecoveryd ) Either form of display is subject to potential truncation if it's too long to fit in this field's current width. That width depends upon other fields selected, their order and the current screen width. Note: The 'Command' field/column is unique, in that it is not fixed-width. When displayed, this column will be allocated all remaining screen width (up to the maximum 512 characters) to provide for the potential growth of program names into command lines.
Will that do anything for me?