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

all 35 comments

sorted by: hot top controversial new old
[–] 46 points 1 year ago* (10 children)

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!

  • source
  • hideshow 10 child comments
  • [–] [S] 14 points 1 year ago (9 children)

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

  • source
  • parent
  • hideshow 9 child comments
  • [–] 2 points 1 year ago (2 children)

    I always killed processes with ps -ef | grep and then kill

    you could check pgrep <process-name> too

  • source
  • parent
  • hideshow 2 child comments
  • [–] [S] 2 points 1 year ago (1 child)

    That is a good tip. Unfortunately, I am too fish to understand it. 🙃

    I just type ps and in 9 out of 10 cases, my shell suggests ps -ef | grep <process-name>. So, it's actually less for me to type than "pgrep"...

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 1 year ago*

    Far from me to try to bash a suggestion's on one's head but ^rpg or ^r<process-name> (for reverse-i-search) is probably quite fast, obviously depends entirely on your typical usage. Hard to do less than 2 keystrokes I admit.

  • source
  • parent
  • [–] 28 points 1 year ago* (1 child)

    Why are good features never made defaults in some tools? We can make it look almost like htop and it feels like the defaults couldn't be worse. It's such a waste to hide good features behind bad defaults.

  • source
  • hideshow 1 child comment
  • [–] [S] 16 points 1 year ago

    Yeah, I especially don't understand it here, because it's a graphical tool. You don't have to keep backwards compatibility.

    Even if you're worried about people depending on the format that's being piped, you could keep only the piped format stable. We have the technology.

  • source
  • parent
  • [–] 49 points 1 year ago* (1 child)

    That moment when you realize you're not in !onehundredninetysix@lemmy.blahaj.zone and people are talking about an entirely different kind of top than you were thinking.


    This is dope, though, I also thought top was just stuck in time.

  • source
  • hideshow 1 child comment
  • [–] 17 points 1 year ago (3 children)
  • [–] 3 points 1 year ago (2 children)

    My go-to! There's a Python version, bpytop, as well - not sure why you would want that over the C++-version though.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 1 year ago

    Ther's a Python version... not sure why you would want that

    Just guessing but maybe for different architecures like RiscV and PPC? It might still be possible to compile from source, but if you have python why not just take a shortcut

  • source
  • parent
  • [–] 12 points 1 year ago

    I'm also underappreciated top

  • source
  • [–] 10 points 1 year ago

    I wish the author can just share a configuration file. I am not configuring this on all my machines manually.

  • source
  • [–] 9 points 1 year ago

    Defaults matter

  • source
  • [–] 5 points 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.

  • source
  • [–] 5 points 1 year ago* (last edited 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

  • source
  • [–] 4 points 1 year ago

    Saving for later, pretty cool.

  • source
  • [–] 3 points 1 year ago

    Top reads available memory more correctly than htop imho.

  • source
  • [+] 4 points 1 year ago* (last edited 1 year ago) (2 children)
  • [–] 5 points 1 year ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • load more comments (-1 replies)
  • [–] 2 points 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.

  • source
  • [–] 4 points 1 year ago (2 children)

    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.

  • source
  • hideshow 2 child comments
  • [–] 7 points 1 year ago (1 child)

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

    apparently it has it all

    https://lemmy.today/comment/20055580

  • source
  • parent
  • hideshow 1 child comment
  • [–] 0 points 1 year ago

    Ok, fair enough. It has meters. Most alternatives exist to show data a graphs; top is sparse in þis way. I stand by my comment: btop, gotop, and ilk exist to look pretty, and sometimes a histogram can be informative, but usually top is much more of a useful tool and less of a fancy dashboard.

  • source
  • parent
  • [–] 1 point 1 year ago

    I just hate how top doesnt format the values into mb, gb and tb. Its 2025 we dont need to see things in bytes. It makes me skip top and go straight to htop

  • source
  • 12 comments in c/linux@programming.dev view that post
    [–] 48 points 1 year ago

    Underappreciated top

    That was my nickname in college.

  • source
  • [–] 17 points 1 year ago (1 child)

    Top is really versatile, but I still love my btop.

  • source
  • hideshow 1 child comment
  • [–] 15 points 1 year ago (6 children)

    Very cool, thanks. I migrated from top to htop a while ago and never looked back, but I occasionally have to use machines that don't have htop so it might be time to get familiar with the default tooling.

    Why do they say that SIGKILL bad practice? I use it as the second tap if a SIGTERM doesn't knock something out. The link in the article is 404ing.

  • source
  • hideshow 6 child comments
  • [–] 11 points 1 year ago* (last edited 1 year ago) (5 children)

    SIGKILL is a good way to orphan children. Or end a DB transaction without properly closing it (so the server socket stays open, or the transaction lock isn't released...) It exists for a reason, but docs usually caution against it because it can cause unexpected behaviors.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 7 points 1 year ago (3 children)

    Eh, system will take care of the orphans

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 1 year ago (2 children)

    Turning them into Zombies is certainly a way of dealing with orphans, sure...

  • source
  • parent
  • hideshow 2 child comments
  • [–] 21 points 1 year ago

    As a bottom, I appreciate all 12 tops that exist at any given time.

  • source
  • [–] 1 point 1 year ago

    Defaults matter

  • source