Introduction
If you’re a Linux user, you know how important it is to keep an eye on your system’s performance. This tutorial will guide you through some of the top tools for gathering information in Linux, including top, htop, and glances. Let’s dive in!
Using the ‘top’ Command
The ‘top’ command is a real-time system monitoring tool that comes pre-installed on most Linux distributions. It provides a dynamic, real-time view of the processes running on your system.
Basic Usage
To use the ‘top’ command, simply open your terminal and type ‘top’. You’ll see a screen similar to this:
top - 15:20:01 up 5:57, 1 user, load average: 0.00, 0.01, 0.05 Tasks: 88 total, 1 running, 87 sleeping, 0 stopped, 0 zombie %Cpu(s): 3.6 us, 1.7 sy, 0.0 ni, 94.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 4046876 total, 2821124 free, 609068 used, 617684 buff/cache KiB Swap: 1048572 total, 1048572 free, 0 used. 3302900 avail Mem
Using the ‘htop’ Command
The ‘htop’ command is an interactive process viewer for Unix systems. It’s a more user-friendly alternative to the ‘top’ command, with a more visually appealing interface and easier navigation.
Installation and Basic Usage
To install ‘htop’, use the following command:
sudo apt-get install htop
Once installed, you can start ‘htop’ by typing ‘htop’ into your terminal. You’ll see a screen similar to this:
1 [||||||||||||||||||||||||||||100.0%] Tasks: 31, 84 thr; 1 running 2 [||||||||||||||||||||||||||||100.0%] Load average: 0.00 0.01 0.05 Mem[|||||||||||||||||||||||387/1998MB] Uptime: 00:09:13 Swp[|||||||||||||||||||||||0/1023MB]
Using ‘glances’
‘Glances’ is a cross-platform system monitoring tool written in Python. It provides a comprehensive overview of various system attributes including CPU, memory, load, network, disk I/O, and more.
Installation and Basic Usage
To install ‘glances’, use the following command:
sudo apt-get install glances
Once installed, you can start ‘glances’ by typing ‘glances’ into your terminal. You’ll see a screen similar to this:
CPU [||||||||||||||||||||||||||||100.0%] Tasks: 31; 1 running MEM [|||||||||||||||||||||||387/1998MB] Load: 0.00 0.01 0.05 SWAP [|||||||||||||||||||||||0/1023MB] Uptime: 00:09:13 NET eth0 RX: 0b/s TX: 0b/s
Conclusion
Monitoring your Linux system is crucial for maintaining its health and performance. With tools like ‘top’, ‘htop’, and ‘glances’, you can easily keep an eye on your system’s performance and manage your resources effectively. Happy monitoring!