Notifications
Clear all
Topic starter
06/03/2024 9:34 pm
Great idea making this sub-forum! Here is my contribution. My cheat sheet encompasses a broad spectrum of commands for retrieving system information and managing system resources.
Command | Description |
---|---|
uname -a |
Display all available system information (kernel name, nodename, kernel release, kernel version, machine, processor, hardware platform, and operating system). |
hostname |
Show the system's network name. |
top |
Display an overview of currently running processes, including information on CPU and memory usage. |
htop |
An interactive process viewer (similar to top) that is more user-friendly and allows for process management (requires installation on some distributions). |
uptime |
Show how long the system has been running, including load average. |
who |
Show who is logged in to the system. |
w |
Display detailed information about the users currently on the machine, their processes, and system load. |
last |
Show a listing of last logged in users. |
df -h |
Display disk space usage for all mounted filesystems (-h for human-readable format). |
du -sh directory |
Show the disk usage of a directory and its subdirectories (-s for summary and -h for human-readable format). |
free -m |
Display the amount of free and used memory in the system (-m for output in megabytes). |
vmstat |
Report virtual memory statistics. |
iostat |
Display CPU and input/output statistics for devices and partitions (installation might be required). |
netstat |
Show network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. |
ss |
An alternative to netstat that displays more detailed network statistics. |
ip addr show |
Display all IP addresses associated with all network interfaces. |
ifconfig |
Display the current network configuration for all interfaces (deprecated in favor of ip addr show in many distributions). |
ps aux |
Show all running processes regardless of owner (a ), with a user-oriented format (u ), and show processes for all users (x ). |
kill pid |
Send a signal to a process, typically to stop the process, where pid is the Process ID. |
killall processname |
Kill all processes with the given name. |
systemctl start service |
Start a systemd service. |
systemctl stop service |
Stop a systemd service. |
systemctl restart service |
Restart a systemd service. |
systemctl status service |
Show the current status of a systemd service. |
systemctl enable service |
Enable a systemd service to start on boot. |
systemctl disable service |
Disable a systemd service from starting on boot. |
journalctl |
Query and display messages from the journal (systemd's logging system). |
dmesg |
Display the kernel ring buffer messages, useful for diagnosing hardware and driver issues. |
lsblk |
List information about all available or the specified block devices. |
lscpu |
Display information about the CPU architecture. |
lshw |
List hardware configuration of the system (installation might be required). |
lsmod |
Show the status of modules in the Linux Kernel. |
modprobe module |
Add or remove modules from the Linux Kernel. |
Divya Kiran Kumar reacted