'top'

Discussion in 'Command Line' started by MustangV10, Nov 12, 2011.

  1. MustangV10

    MustangV10 New Member

    Messages:
    87
    Likes Received:
    3
    Trophy Points:
    0
    I know of top -s, top -c and top -s -c. What other expressions are there for top? What do they do?

  2. majcherek2048

    majcherek2048 New Member

    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Use the command: "man top" (Without quotes), or Google: "man top" (again without quotes) ;)
  3. arran

    arran Guest

    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
    DevynCJohnson likes this.
  4. carbon333

    carbon333 New Member

    Messages:
    87
    Likes Received:
    6
    Trophy Points:
    0
    It's also worth noticing that htop is more powerful (and good-looking) tool than regular top.
    bashcommando likes this.
  5. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,336
    Likes Received:
    1,074
    Trophy Points:
    113
    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>
  6. Kovax

    Kovax Member

    Messages:
    34
    Likes Received:
    18
    Trophy Points:
    8
    Remember that the "man pages" are your friend.
  7. GrumpyOldMan

    GrumpyOldMan Active Member

    Messages:
    136
    Likes Received:
    45
    Trophy Points:
    28
    And if you aren't familiar with man, then use "man man"
    Kovax likes this.
  8. Kovax

    Kovax Member

    Messages:
    34
    Likes Received:
    18
    Trophy Points:
    8
    That's so funny because I used to tell my co-workers that one all the time LOL
  9. B4RTZ4K

    B4RTZ4K New Member

    Messages:
    19
    Likes Received:
    13
    Trophy Points:
    3
    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.

    Regards ;) b4rtz4k

    Oh and I am Dutch (makes it even harder to understand linux):confused:
    Last edited: Jan 25, 2014
    DevynCJohnson likes this.
  10. byau

    byau New Member

    Messages:
    4
    Likes Received:
    3
    Trophy Points:
    1
    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.
    DevynCJohnson likes this.
  11. MikeyD

    MikeyD Active Member

    Messages:
    232
    Likes Received:
    112
    Trophy Points:
    43
    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):

    Code:
    /EXAMPLES
    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:

    Code:
    :set hlsearch
  12. bashcommando

    bashcommando Active Member

    Messages:
    212
    Likes Received:
    43
    Trophy Points:
    28
    And there is ntop
    DevynCJohnson likes this.

Share This Page