top command

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.
Who is Participating?
Gerwin Jansen, EE MVEConnect With a Mentor Topic Advisor Commented:

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.