...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
top/htop # Real-time process monitoring.
vmstat # Reports virtual memory statistics.
free -h # Displays memory usage.
mpstat: # Reports CPU usage. |
Div |
---|
|
3. Disk Usage and Health |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
df -h # Shows disk space usage.
du -sh /path/to/directory # Displays the size of a specific directory.
fdisk -l # Lists all partitions.
smartctl -a /dev/sda # Checks the health of a disk (requires smartmontools).
iostat # Reports CPU and I/O statistics. |
Div |
---|
|
54. Process and Service Management |
Managing processes and services is essential for maintaining system stability.
...
ps aux: Lists all running processes.
systemctl status service_name: Checks the status of a service.
journalctl -u service_name: Views logs for a specific service.
kill -9 process_id: Forces termination of a process.
nice and renice: Adjusts process priority.
bash
ps aux
systemctl status service_name
journalctl -u service_name
kill -9 process_id
nice -n 10 process_name
renice -n 10 process_id
...
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
ps aux # Lists all running processes.
systemctl status service_name # Checks the status of a service.
journalctl -u service_name # Views logs for a specific service.
kill -9 process_id # Forces termination of a process.
nice and renice # Adjusts process priority. |
Div |
---|
|
5. Logs and Monitoring |
Analyzing logs and monitoring system activities can help in identifying issues and tracking system performance.
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
...
...
...
# Prints kernel ring buffer messages. |
...
...
...
...
logs.
journalctl -u service_name # Views logs for a specific service.
tail -f /var/log/syslog |
...
# Continuously displays system log updates. |
...
...
...
# Collects, reports, and saves system activity information (requires sysstat). |
...
...
...
# Shows how long the system has been running and load averages. |