| Category | Command | Description | Platform |
| Operating System Version | lsb_release -a | Displays detailed information about the Linux distribution. | Ubuntu/Debian |
| cat /etc/os-release | Outputs information about the installed operating system. | All distributions | |
| cat /etc/issue | Displays a brief information about the distribution. | All distributions | |
| cat /etc/redhat-release | Specific to Red Hat-based systems, displays the version. | RHEL/CentOS | |
| Kernel Version | uname -a | Displays all the information about the kernel. | All distributions |
| uname -r | Displays the kernel release version. | All distributions | |
| Hardware Information | lscpu | Displays CPU architecture information. | All distributions |
| LSHW | Lists detailed hardware information (may need to be installed). | All distributions | |
| LSPCI | Displays information about PCI devices. | All distributions | |
| LSUSB | Displays information about USB devices. | All distributions | |
| dmidecode | Displays hardware information from the BIOS/UEFI (requires root privileges). | All distributions | |
| Storage Information | free -h | Displays the current memory consumption. | All distributions |
| vmstat | Displays information about system processes, memory, paging, block I/O, and CPU activity. | All distributions | |
| cat /proc/meminfo | Displays detailed information about the memory. | All distributions | |
| Disks and partitions | df -h | Displays the disk space of the file systems. | All distributions |
| du -sh /path | Displays the size of a directory or file. | All distributions | |
| LSBLK | Lists block devices such as hard drives and partitions. | All distributions | |
| fdisk -l | Lists partition tables and disk information (requires root privileges). | All distributions | |
| blkid | Displays UUIDs and types of file systems. | All distributions | |
| Network information | IP Addr Show | Displays network interfaces and IP addresses. | All distributions |
| ifconfig | Older command to display network interfaces (may need to install net-tools). | All distributions | |
| netstat -tuln | Lists all open ports (may need to install net-tools). | All distributions | |
| SS -Tuln | Modern replacement for netstat, shows open ports and connections. | All distributions | |
| hostname -i | Displays the IP addresses of the host system. | All distributions | |
| Process Information | top | Real-time view of running processes and system utilization. | All distributions |
| htop | Improved version of top with a user-friendly interface (must be installed). | All distributions | |
| ps aux | Lists all running processes with details. | All distributions | |
| pstree | Displays processes in a tree-like structure. | All distributions | |
| Users and Groups | who | Displays which users are currently logged in. | All distributions |
| w | Displays logged-in users and their activities. | All distributions | |
| id | Displays user and group IDs of the current user. | All distributions | |
| Load | Displays users’ login history. | All distributions | |
| System logs | DMESG | Displays kernel and system messages. | All distributions |
| journalctl | Displays logs of the system (systemd-based systems). | All distributions | |
| tail -f /var/log/syslog | Real-time view of system logs (Ubuntu/Debian). | Ubuntu/Debian | |
| tail -f /var/log/messages | Real-time view of system logs (RHEL/CentOS). | RHEL/CentOS | |
| Package management | dpkg -l | Lists installed packages (Debian-based). | Ubuntu/Debian |
| rpm -qa | Lists installed RPM packages. | RHEL/CentOS | |
| apt list –installed | Displays a list of installed packages. | Ubuntu/Debian | |
| yum list installed or dnf list installed | Displays installed packages (YUM or DNF depending on the version). | RHEL/CentOS | |
| System Services | systemctl list-units –type=service | Lists all active services (systemd). | All distributions |
| service –status-all | Lists the status of all services (SysVinit systems). | All distributions | |
| Environment Variables | env | Displays all environment variables. | All distributions |
| Printenv | Outputs environment variables (can be used with variables, e.g. printenv PATH). | All distributions | |
| Time synchronization | timedatectl | Displays date, time, and time zone settings. | All distributions |
| ntpq -p | Displays the status of the NTP service (if installed). | All distributions | |
| Other Useful Commands | uptime | Shows how long the system has been running and the average system load. | All distributions |
| uname -m | Displays the architecture of the system (e.g. x86_64). | All distributions | |
| cat /proc/cpuinfo | Detailed information about the CPU. | All distributions | |
| cat /proc/version | Displays kernel version and information. | All distributions | |
| Kernel Modules | lsmod | Lists loaded kernel modules. | All distributions |
| ModInfo Module Name | Displays information about a specific kernel module. | All distributions | |
| Software and Services | chkconfig –list | Lists startup services (SysVinit, RHEL/CentOS). | RHEL/CentOS |
| update-rc.d -n -f service remove | Displays startup services (SysVinit, Ubuntu/Debian). | Ubuntu/Debian | |
| Special tools | inxi -F | Displays extensive system information (must be installed). | All distributions |
| Neofetch | Displays system information in a clear format (requires installation). | All distributions | |
| screenfetch | Similar to neofetch, displays system information with logo (must be installed). | All distributions |
Notes on the commands
- Installation of additional tools:
- Ubuntu/Debian:
- sudo apt update
- sudo apt install htop lshw inxi neofetch
- RHEL/CentOS:
- sudo yum install epel-release (for additional repositories)
- sudo yum install htop lshw inxi neofetch
- Ubuntu/Debian:
- Root privileges: Some commands require elevated privileges. Add sudo before the command to run it with administrator privileges.
- Deprecated commands: Commands like ifconfig and netstat are deprecated. Use ip and ss instead.
Examples
- To view CPU information:
Lscpu
- View all network interfaces and their IP addresses:
IP Addr Show
- Monitor memory usage in real-time:
watch -n 1 free -h
- To determine the size of directories:
du -sh /var/log
- List of the 10 processes with the highest memory consumption:
ps aux –sort=-%mem | head -n 11
Tips
- Using man pages: Use man command to go to the manual page of a command and get detailed information.
- Autocomplete: Use the Tab key to autocomplete commands and file names.
- Browse history: Press Ctrl + R to search the command history backwards.
Differences between distributions
- Package Manager:
- Ubuntu/Debian: Use apt or dpkg.
- RHEL/CentOS: Use yum or dnf and rpm.
- System logs:
- Ubuntu/Debian: Main logs are located in /var/log/syslog.
- RHEL/CentOS: Main logs are located in /var/log/messages.
- Service management:
- Both now use systemctl for systemd, but older systems can use service or chkconfig.
Additional Resources
- Documentation:
- Official documentation of the distributions provides comprehensive information.
- Online forums and communities such as Stack Overflow, Ubuntu Forums or CentOS Forums.
- Further tools:
- Glances: A cross-system monitoring tool.
- nmon: Monitoring tool for performance measurements.

