Top Command

Home » CentOS » Top Command
CentOS 4 Comments

Hi,

I am running CentOS 6.4 on a remote server. when i run the below command, it prints out the headers too. is there a way to remove headers using the below command line

*top -b -p 22657 > topcpu.txt*

Regards,

Kaushal

4 thoughts on - Top Command

  • If you’re looking for CPU usage examine the output of:

    ps -p 22657 –no-headers -o “%C”

    If that is what you’re looking for then stick it in a bash script loop that repeats the command at your required frequency (hint: use “sleep”
    to pause a few seconds and check the ps manual page for other output
    (e.g. memory usage) that you might also want.

LEAVE A COMMENT