Results 1 to 4 of 4
Hi All,
We are migrating all shell scripts from Unix to Linux. One of the scripts is using top command in Unix which is like
numProcs=5
/usr/local/bin/top -Sb -d1 $numProcs
...
- 02-23-2009 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 6
top command in Linux
Hi All,
We are migrating all shell scripts from Unix to Linux. One of the scripts is using top command in Unix which is like
numProcs=5
/usr/local/bin/top -Sb -d1 $numProcs
where numProcs is variable , options used with top are as follows:
S is for showing system processes
b is for Batch mode
dcount is for showing only count displays.
But in Linux the same command have different syntex and I want to implement the same functionality as unix in Linux..
So Can you help me in finding what will be the eqivalent for the top command above in Linux.
Thanks in Advance.
- 02-23-2009 #2
The complete text for the syntax can be displayed by "man top".
For 5 years or so, the top command shows system processes by default in all GNU/Linux distributions I know.
The batch mode option is the same.
The "dcount" may refer to the number of iterations, -n here.Debian GNU/Linux -- You know you want it.
- 02-23-2009 #3Just Joined!
- Join Date
- Oct 2008
- Posts
- 6
Yes..I had gond through the man page for top cmd in Linux.
Earlier I couldn't find any option for selecting system processes..so As you said it will take system processes by default . That is ok now. and that batch mode with -b option is also ok.
But when I specify -n count , it displays the set of records 5 times , In each set it has 29 processes.
SO I am not getting how its doing that and what should I use to get the desired result with top ???
- 02-23-2009 #4
What is the desired result?
Debian GNU/Linux -- You know you want it.


Reply With Quote