Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

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. Thanks!

'top'

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

  1. MustangV10

    MustangV10 Guest

    I know of top -s, top -c and top -s -c. What other expressions are there for top? What do they do?


     
  2. 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
     
    1 person likes this.
  4. carbon333

    carbon333 Guest

    It's also worth noticing that htop is more powerful (and good-looking) tool than regular top.
     
    1 person likes this.
  5. 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>
     
    2 people like this.
  6. Kovax

    Kovax Guest

    Remember that the "man pages" are your friend.
     
  7. GrumpyOldMan

    GrumpyOldMan Guest

    And if you aren't familiar with man, then use "man man"
     
    1 person likes this.
  8. Kovax

    Kovax Guest

    That's so funny because I used to tell my co-workers that one all the time LOL
     
  9. B4RTZ4K

    B4RTZ4K Guest

    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:
     
    #9 B4RTZ4K, Jan 25, 2014
    Last edited: Jan 26, 2014
    1 person likes this.
  10. byau

    byau Guest

    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.
     
    1 person likes this.
  11. MikeyD

    MikeyD Guest

    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 Guest

    And there is ntop
     
    1 person likes this.

Share This Page