Always thought top was one of those programs frozen in time since the 70s, but apparently, it has a feature set comparable to htop and the like. The default configuration just doesn’t show much of it…

  • paequ2 ( paequ2@lemmy.today ) 
    link
    fedilink
    arrow-up
    31
    ·
    1 year ago

    Wow. wat. This is top??

    top

    The only reason I use htop is because I never bothered to learn top. I’m totally down to avoid downloading and installing another utility though. The time to learn top is TODAY!

    • Ephera ( Ephera@lemmy.ml ) OP
      link
      fedilink
      English
      arrow-up
      13
      ·
      1 year ago

      Yeah, I would often just grab htop because I had no idea how to read the CPU usage out of top.
      For example, for me it says:

      %Cpu(s):  0,4 us,  0,4 sy,  0,0 ni, 98,8 id,  0,0 wa,  0,3 hi,  0,0 si,  0,0 st
      

      Now that I look at it, I can guess that us and sy are supposed to be user and system time. And I guess id is supposed to be idle.
      I have no guess what the other numbers might be, though. And well, I would often like to see the CPU usage per core.
      Now I know that I can just press 1t and get effectively the same view as in htop.

      I might learn top’s filtering workflow, too. But so far, I always killed processes with ps -ef | grep <process-name> and then kill <pid>, which isn’t particularly more cumbersome, so will see…

  • Ŝan • 𐑖ƨɤ ( Sxan@piefed.zip ) 
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    It’s not as fancy. No graphs, blinking lights, paneled layout.

    I maintain one of þose fancy nu-tops, and I keep it running for þe pretty… but when I want to get work done, I always end up opening top. Because in þe end, columns of text are almost always more useful þan histograms.

  • Papamousse ( Frederic@beehaw.org ) 
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    1 year ago

    I am using top for a long time, when I log on a system to check thing, I always type “s 1” to refresh 1 second, “e” to display in mb, “shift e” if top is not in mb, “c” to toggle name/command line, then “W” to save

  • paequ2 ( paequ2@lemmy.today ) 
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    I missed this part during my first read:

    This screen allows you to customise which fields are displayed in the currently selected window. Use cursor keys (or Alt + j and k) to move up and down this list, d to toggle whether a field is displayed and s to choose the field by which the window is sorted.

    and when I tried it, it seemed like my commands weren’t doing anything… so in case anyone else finds this helpful…

    How to sort columns in top.

    • Launch top
    • Press f (not SHIFT+F)
    • Use arrow keys or alt+j / alt+k to select a column
    • Press s to sort by the column you’ve currently selected
      • note: you won’t get any obvious feedback, this is normal… I guess
      • look at the top line: whose current sort field is $COLUMN_NAME
      • this line will change when you press s
    • Press q to exit the Fields Management screen
    • Selected column should now be sorted from largest to smallest

    At this point, top may not look like it sorted the selected column. It may be helpful to tell top to highlight the currently sorted column. Press x to do this.

    Now it should be easier to tell which column was sorted.

    • paequ2 ( paequ2@lemmy.today ) 
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      Wait… what?

      $ top --version
      top from procps-ng 4.0.5-dirty
      

      The following utilities are provided by procps:

      • free - Report the amounts of free and used memory in the system
      • hugetop - Report hugepage usage of processes and the system as a whole
      • kill - Send a signal to a process based on PID
      • pgrep - List processes based on name or other attributes
      • pkill - Send a signal to a process based on name or other attributes
      • pmap - Report the memory map of a process
      • ps - Report process information including PID and resource usage
      • pwdx - Report the current working directory of a process
      • skill - Obsolete version of pgrep/pkill
      • slabtop - Display kernel slab cache information in real time
      • snice - Renice a process
      • sysctl - Read or write kernel parameters at run-time
      • tload - Graphical representation of system load average
      • top - Dynamic real-time view of running processes
      • uptime - Display how long the system has been running
      • vmstat - Report virtual memory statistics
      • w - Report logged in users and what they are doing
      • watch - Execute a program periodically, showing output fullscreen

      https://gitlab.com/procps-ng/procps

      Oh, so these guys manage top and a few other common utilities.

  • Digit ( Digit@lemmy.wtf ) 
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Now if only I could hack up top to show which bedrock stratum each process running from, like paradigm did for me one christmas with (a now old version of) htop, I might consider learning how to use top.

    Htop’s hard to beat.

    Others, like btop, are too heavy, too try-hard.

    Would be nice if top were as convenient and easy. Oh wait, that’s basically htop, again.