r/linuxquestions • • 14d ago

Advice Command that will give you the current state of your Linux box.

I see frequently posts of people who create programs to show the state of there Linux box. Usually contains, network traffic, CPU usage, memory usage and more. They all run off the command line. I usually just scroll past them. I starting to think they may be useful to me. Now since I am looking for them, I can not find a single one. I am looking for recommends. Some thing I can have running on a terminal all the time.

47 Upvotes

48 comments sorted by

22

u/Guggoo 14d ago

You probably want something like btop

6

u/balefyre 14d ago

btop htop glances (btop does it the best though)

1

u/rarsamx 12d ago

I use both. Sometimes I prefer htoo

1

u/rarsamx 12d ago

I use both. Sometimes I prefer htop

3

u/mezzfit 14d ago

For other modern tools I would add netwatch for network and gdu for disk usage.

17

u/Dolapevich Please properly document your questions :) 14d ago edited 12d ago

So... you might be thinking about neofetch ( I am told it is fastfetch nowadays ) that shows a nice output, but that is usually for eye candy.

You need to think in terms of resources. CPU, RAM, DISK, NETWORK are the main resources. There are different commands to inspect those. And some that intergrate many in a single view.

Here is a cheat sheet with commands to inspect different parts of the system: https://personales.unican.es/corcuerp/linux/resources/LinuxCommandLineCheatSheet_1.pdf

Also, since unix/linux has ~60 years of history, some of them might be deprecated, but still refered in old documentation.

Case in point, the original venerable BSD tools to configure and inspect network configuration were arp, ifconfig, netstat, rarp, nameif and route.

Those tools were absolutely superseeded by the current generation: ip, tc, and ss.

13

u/smallgodinacan 13d ago

neofetch is no longer being developed since April 2024, fastfetch is a popular spiritual successor: https://github.com/fastfetch-cli/fastfetch

5

u/Dolapevich Please properly document your questions :) 13d ago

Thanks! I am more an inxi guy myself :)

4

u/47-45-45-4B 13d ago

Oldie but a goodie

Get all your documentation there

1

u/Dolapevich Please properly document your questions :) 13d ago

That used to be my go to site back in the 2000s. Good times!

3

u/47-45-45-4B 13d ago

Yep. and still has great info. Especially for a n00b

2

u/Dolapevich Please properly document your questions :) 13d ago

Indeed. I don't remember the topic, but I sent someone to read there recently.

3

u/47-45-45-4B 13d ago

I love that the old gods are still respected with the new gods. Thank you.

We worked really hard for documentation. It’s one of my weird quirks at various jobs. Document your shit.

8

u/Mister_Pibbs 14d ago

I like htop

8

u/treuss 14d ago

with dmesg, top and df you'll get a pretty good survey over your system's health. Especially top is very underrated. One short glance to the three sysload numbers on the top right corner usually shows enough information to device if further checks are necessary. Check out its man page, it's totally worth it.

vmstat, ss and iostat are very helpful too if you cannot find the reason for some trouble.

I'm not a big fan of fastfetch, neofetch etc., since you won't find them on every machine and sometimes you're probably not even able to install them on a machine in trouble.

7

u/spryfigure 14d ago

I agree that fastfetch, neofetch are toys, but you should install inxi before you run into trouble. inxi's output is a godsend if you help someone with troubleshooting.

6

u/Dashing_McHandsome 14d ago

vmstat, mpstat, sar, iostat, dtrace, bpftrace

3

u/treuss 14d ago

sar is so very helpful!

0

u/47-45-45-4B 13d ago

Completely underrated tool

4

u/Robold_12 14d ago

Many are posting the output from fastfetch in Terminal. It can be installed with sudo apt install fastfetch if you are on Debian or similar.

3

u/ziggyw00t 14d ago

I use glances pretty often.

1

u/Molasses_Major 14d ago

another vote for glances here

1

u/computer-machine 13d ago

Have used for years. Recently switched to Docker container, not sure how to feel about web view.

I guess on the plus you can actually scroll around on mobile.

2

u/aieidotch 14d ago

i like https://github.com/alexmyczko/ruptime with multiple computers

2

u/scorp123_CH 14d ago

I always leave an instance of btop running in a terminal ... old habit. Plus it looks cool. πŸ‘

2

u/trailhounds 13d ago

sar, vmstat, or dstat are the best that are most likely installed already. All of the "*top"s are sort of interactive.

1

u/Rincewindcl 14d ago

Bpytop

4

u/mezzfit 14d ago

You should btop now, since it's written in C++ and not python.

1

u/NeedleworkerLarge357 14d ago

Btop is great out of the box, htop can be configured quite well. Atop shows a ton of helpful information that will overwhelm you if you're no expert, but it also has a nice overview with "atop -B". Those are the tools I usually use.

1

u/xRolox 14d ago

atop is a nice continuous and present state monitor

1

u/The-Princess-Pinky 14d ago

I use nmon. It shows everything you need quite clearly. It can also be run in batch mode to create a file that is read by the nmon analyzer, which creates graphs for you.

1

u/Prestigious-Bet-6534 14d ago

gotop is nice, it has graphs for cpu/memory usage and also displays network, disks and temperatures

1

u/Kokumotsu36 14d ago

fastfetch, btop, You can even setup waybar or quickshell to have all the info you need in there without the need for a Term

1

u/SadServers_com 13d ago

- top/htop/atop gives you a good view of processes, memory and CPU.
- for disk space: df -h, and iotop for disk i/o.
- for networking you can use ss for example

A cheatsheet: https://docs.sadservers.com/docs/troubleshooting/linux-server-review/ , you can practice this problem of "finding the current state of the Linux box" with this hands-on scenario: https://sadservers.com/scenario/linux-server-review

2

u/CyclingHikingYeti Debian sans gui 13d ago

also btop for swiss-army-knife do-it-all

1

u/SadServers_com 13d ago

yes, forgot that ?top thanks

1

u/libben 13d ago

You also could look into Daves TMOG.org I like it alot.

1

u/Y-L-S-E 13d ago

If you want to see how much is being used on all fronts (to see how borked your shit is) btops pretty nice

1

u/PortableShell 13d ago

I don't have any command-line suggestions, but some years ago I did write a small X11 app that creates a thin panel at the top (or bottom) of your screen and shows some information about your system's memory usage, CPU load, network activity, and battery level.

You can find it here:

https://github.com/yetanothergeek/says

1

u/Super-Revolution-433 11d ago

Htop is nice for something quick and easy out of the box. If you want something specific to you then I'd look into install quickshell and making a display panel that shows what you want

1

u/jlrueda 9d ago

maybe the "command line flight recorder" can hekp you: https://github.com/jlruedab/clifr

1

u/jlrueda 9d ago

top is the Linux default command to see the current state. If you ever want to see the state from any past moment you can use clifr:

clifr --at "PAST_MOMENT" top

clifr

0

u/loligans 13d ago

Anything that shows: CPU, RAM, MEM, DISK, and Security? With how AI has been uncovering vulnerabilities left and right, is there a tool that scans your device for vulnerabilities of known SVEs?

-5

u/OutrageousCrab9224 14d ago

No such thing

-3

u/bagpussnz9 13d ago

Claude, my laptop fans a bit noisy. Fix it please...... Thank you