Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
themeMidnight
titleCommands
    top/htop # Real-time process monitoring.
    vmstat # Reports virtual memory statistics.
    free -h # Displays memory usage.
    mpstat: # Reports CPU usage.


Div
classtitle-box

3. Disk Usage and Health

...

Code Block
languagebash
themeMidnight
titleCommands
    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
classtitle-box
5

4. Process and Service Management

Managing processes and services is essential for maintaining system stability.

Code Block

...

    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

...

languagebash
themeMidnight
titleCommands
    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
classtitle-box

5. Logs and Monitoring

Analyzing logs and monitoring system activities can help in identifying issues and tracking system performance.

Code Block
languagebash
themeMidnight
titleCommands

...

   

...

 dmesg

...

 # Prints kernel ring buffer messages.

...


   

...

 journalctl

...

 # Views systemd

...

 logs.
    journalctl -u service_name # Views logs for a specific service.
    tail -f /var/log/syslog

...

 # Continuously displays system log updates.

...


   

...

 sar

...

 # Collects, reports, and saves system activity information (requires sysstat).

...


   

...

 uptime

...

 # Shows how long the system has been running and load averages.