We help IT Professionals succeed at work.

top command

netplus21 asked
I typed the following command in order to be able to view more than one screen of the top command:

top -b -d 1 > ~/top.list

I pressed 'control q' for the command to stop.

I located the top.list file and it was quite large even though the command hadn't been running for long.

My question is, was 'control q' enough to stop the command or might the top.list file be created again?

thanks for your help.
Watch Question

Topic Advisor
Most Valuable Expert 2016

top -b means that you run top in batch mode

-d 1 means that you run top with a delay of 1 second

Running top this way means it creates output every second to your file. q quits the top command. Your command will keep on adding output to the file until you quit top.

If you want to run top just once and get output in a file, do this:
top -b -n 1 > ~/top.list

Open in new window

You may add to your output file by using >> instead of > btw.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.