• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 530
  • Last Modified:

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.
1 Solution
Gerwin Jansen, EE MVETopic 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.

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now