Gathering System Information of your Linux box November 26, 2010Posted by Tournas Dimitrios in Linux.
There are some “must known” commands on Linux that helps you gather essential system information . For example, you should know how to find the amount of free memory, the amount of available hard drive space, how your hard drive is partitioned, and what processes are running. This article discusses how to retrieve this type of information from your Linux system using simple commands and a few simple gui- programs.
- df — fdisk
- /proc file system
|[Space]||Immediately refresh the display|
|[h]||Display a help screen|
|[k]||Kill a process. You are prompted for the process ID and the signal to send to it.|
|[n]||Change the number of processes displayed. You are prompted to enter the number.|
|[u]||Sort by user.|
|[M]||Sort by memory usage.|
|[P]||Sort by CPU usage.|
- free : The free command displays the total amount of physical memory and swap space for the system as well as the amount of memory that is used, free, shared, in kernel buffers, and cached. The command "free -m “shows the same information in megabytes, which are easier to read.
- df : The df command reports the system’s disk space usage. By default, this utility shows the partition size in 1 kilobyte blocks and the amount of used and available disk space in kilobytes. To view the information in megabytes and gigabytes, use the command df -h. The -h argument stands for human-readable format . In the list of mounted partitions, there is an entry for /dev/shm. This entry represents the system’s virtual memory file system. To display the system’s disk space usage you can also use fdisk -l
- du : The du command displays the estimated amount of space being used by files in a directory. If you type du at a shell prompt, the disk usage for each of the subdirectories is displayed in a list. The grand total for the current directory and subdirectories are also shown as the last line in the list. If you do not want to see the totals for all the subdirectories, use the command du -hs to see only the grand total for the directory in human-readable format. Use the du --help command to see more options.
- lspci :If you are having trouble configuring your hardware or just want to know what hardware is in your system, you can use the LsHw (Linux hardware tool) application to display the hardware that can be probed. To start the program type hwbrowser at a shell prompt. It displays your CD-ROM devices, diskette drives, hard drives and their partitions, network devices, pointing devices, system devices, and video cards. Click on the category name in the left menu, and the information is displayed. Read this article that demostrates LsHw .
You can also use the lspci command to list all PCI devices. Use the command lspci -v for more verbose information or lspci -vv for very verbose output. For example, lspci can be used to determine the manufacturer, model, and memory size of a system’s video card , or determine the network card in your system if you do not know the manufacturer or model number.
- /proc filesystem : actually this is a virtual filesystem , it occupy “user – space ” system memory (RAM) and not hard drive space . It mirrors the “soul” of your computer , and information can be retrieved through pager utilities like cat , less , more . All previous mentioned system information commands ( ps , top , du , free etc… ) , retrieve information from this virtual file system .See this extensive description of the /proc filesystem.
- gnome-system-monitor : This is graphical GNOME process viewer and system monitor with a nice easy-to-use interface, It has some nice features, such as a tree view for process dependencies, icons for processes, the ability to hide processes that you don’t want to see, graphical time histories of CPU/memory/swap usage, the ability to kill/renice processes needing root access, as well as the standard features that you might expect from a process viewer.