cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: top command

VEL_1
Valued Contributor

Reg: top command

Hi All,

In HP-UX, I can get top 100 process:

$ top -n 100
in screen,
j -> next screen # goes to next screen
k -> previous screen # # goes to next screen

But in linux, how can I get like the above?
3 REPLIES
Vitaly Karasik_1
Honored Contributor

Re: Reg: top command

you may use "n" or "#" for setting such number when top runs; I don't know if exists command-line parameter for this.

Re: Reg: top command

If there's activity in the box, you can get the top 100 using command:
ps -ef|awk '$4>0'|sort -r -k 4,4|head -100
Mike Stroyan
Honored Contributor

Re: Reg: top command

You can also save different configurations by linking the top command to different names.

ln -s /usr/bin/top top100
./top100
#100Wq
./top100

The configuration will be save in ~/.top100rc and reused each time you start ./top100.

By the way, 100 is a lot of lines. You must be using a huge window with a tiny font.