Top command

Hi All,

i am using the below command and once get the output and i need to keep the
first batch only.in this case how to do this one. please help me on this

top -b -n 5 >top.txt

Thanks,

What operating system are you using?

Does the man page for top on your system include an option to specify the number of times top should update the display before exiting?

Does the command:

top -b -d1 5 >top.txt

work on your system? If so, what does it do?

Thanks for quick reply and find the below inform.

Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

and i tried above command it's not working.

What output does the command:

top -b -n1

produce?