Separate names with a comma.
While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again.
Discussion in 'Command Line' started by MustangV10, Nov 12, 2011.
I know of top -s, top -c and top -s -c. What other expressions are there for top? What do they do?
Use the command: "man top" (Without quotes), or Google: "man top" (again without quotes)
below is the list of all switches which are using with top command
l --To display or to hide load average line
t --To display or to hide task/cpu line
1 --To display or hide all other CPU's
m --to display or to hide RAM and SWAP details
s --To change the time interval for updating top results(value is in sec's)
R --To sort by PID number
u -- Press u then username to get only that user process details
P --To sort by CPU utilization
M --To sort by RAM utilization
c --To display or hide command full path
r --To renice a process, press r then the PID no then the renice value to renice a process.
k --To kill a process, press k then PID number then enter to kill a process
w --To save the modified configuration permanently.
q --To quit the top command.
h --for getting help on top command
It's also worth noticing that htop is more powerful (and good-looking) tool than regular top.
Here is a list of top-like utilities:
apachetop - Apache server performance
atop - resources
dnstop - DNS server/traffic info
iotop - Disk activity
itop - system breaks
mtop/mytop - MySQL database info
ptop - Postgres info
sntop - pings for active/inactive hosts
virt-top - Resource info concerning virtual systems
To install any of these on your system:
Debian-based - sudo apt-get install <PACKAGE>
RedHat-based - sudo yum install <PACKAGE>
Slackware-based - sudo slapt-get --install <PACKAGE>
Arch-based - sudo pacman -S <PACKAGE>
Remember that the "man pages" are your friend.
And if you aren't familiar with man, then use "man man"
That's so funny because I used to tell my co-workers that one all the time LOL
I as a newby had a hard time understanding or even reading the man pages.
I was looking at them and said to myself 'wow geniuses at work here', these are manual pages that the developers made and I guess they are a bit of genius. I encountered a nice line in the book Rute User's Tutorial and Exposition. It says as folows:
Man pages, however, will often not contain the underlying concepts needed for understanding the context in which a command is used. Hence, it is not possible for a person to learn about UNIX purely from man pages. However, once you have the necessary background for a command, then its man page becomes an indispensable source of information and you can discard other introductory material.
I had to look for video's, other forums, ubuntu man pages online, but didn't give up also there is a new form of man pages called 'info' they are the more modern version of the man pages. Not always available!!! I have one tip for newby's if you type for example in the terminal man ls or man whatever scroll down and look for the examples at the bottom of the man pages (also not always there). But they give an good example of how to use the options.
If u are at the man page u can type forward slash an then the word u are looking for e.g. /examples in ubuntu 12.04 it highlight the word that u look for or goes direct to the section where it is.
Oh and I am Dutch (makes it even harder to understand linux)
It will behoove you to learn how to read man pages, very helpful as you get better. Search for the word "example" in the man pages - that part of man pages has really developed over the years.
I can feel for newbies. I remember when I first got into Linux the man pages seemed way over my head. There is a fine line between someone wanting more info because they were confused versus someone just too lazy to try and look, which I think can cause a rift for vets answering questions that can be found on the man page. This often ends up with (especially on Stack Overflow it seems) vets angrily telling the person to check the man pages before posting "these kinds of" questions.
To elaborate on what @byau and @B4RTZ4K mentioned, being able to effectively search through man pages can be a difference maker as the wording and just the size of many man pages can be daunting.
The pages adhere to the 'vi' command model, which also makes it tough for newbies to just get around the man page. Heres a quick and dirty example for any newbies checking out this thread:
You start off a search with a '/' character and then the string you want to search for. To search for examples (which is often in all caps):
then n can be used to scroll top-down through the document for all matches and N can be used to scroll backwards (bottom-up) through all the matches.
It can also be easier to spot matches by turning on highlight matching if it isnt already, using:
And there is ntop