System Information using the console

There are some really useful commands that can give information about the system directly from the console. Some of them are:

See a list of all the running processes using standard syntax:

# ps ax | less

See a list of all the running processes using BSD syntax:

# ps aux | less

See real-time information about running processes:

# top

Pressing the L, T, M keys while top is running you can toggle the display of Average Load, CPU and Memory usage respectively. The Space key refreshes the display and Q key quits the program. There are a lot more, so you should check the man page.

Memory and SWAP space usage:

# free -m

Use the -m parameter to show the amount of memory in MB instead of bytes.

Check if a program is running:

# ps ax | grep PROGRAM | grep -v grep

Show filesystem and disk space usage:

# df -h

Show disk usage under the current directory

# du -hs

The -h parameter shows sizes in human readable formats (eg MB, GB) and the -s gives only a total. If it’s not used, then information about each subdirectory is shown.

There are a lot more. I’ll add more commands to this post in a future update. Stay tuned!

System Information using the console by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2005 - Some Rights Reserved

George Notaras avatar

About George Notaras

George Notaras is the editor of the G-Loaded Journal, a technical blog about Free and Open-Source Software. George, among other things, is an enthusiast self-taught GNU/Linux system administrator. He has created this web site to share the IT knowledge and experience he has gained over the years with other people. George primarily uses CentOS and Fedora. He has also developed some open-source software projects in his spare time.