...
Keeping track of disk usage and health is crucial for preventing data loss and ensuring efficient storage management.
df -h # Shows disk space usage in "human-readable" format
...
Code Block | ||||
---|---|---|---|---|
| ||||
du -sh /path/to/directory 1.1G /path/to/director iostat # Reports CPU and I/O statistics. |
fdisk -l # List all partitions
Code Block | ||||
---|---|---|---|---|
| ||||
fdisk -l Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors Disk model: QEMU HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: XXXXXX-XXX-XXX-XXXX-XXXXXXXXXX Device Start End Sectors Size Type /dev/sda1 2048 4095 2048 1M BIOS boot /dev/sda2 4096 41940607 41936512 20G Linux filesystem |
...
Managing processes and services is essential for maintaining system stability.
ps aux # aux Lists all running processes
...
systemctl status service_name # name Checks the status of a service
...
/var/log/auth.log or /var/log/secure - Stores authentication logs, including both successful and failed logins and authentication methods. Debian/Ubuntu information is stored in /var/log/auth.log, while Redhat/CentrOS is stored in /var/log/secure.
/var/log/apt directory - on Debian-based systems , we can find the logs for the apt package manager on Debian-based systems, directory contains several log files that provide important information about apt-related activities on the system.
/var/log/yum.log - Red Hat-based systems store the yum and dnf package manager logs, file provides information about the results of a specific command, such as any errors or warnings that were generated. For example, if a package update fails,
/var/log/dmesg
dmesg# allows reviewing messages stored in the Linux ring buffer, providing insights into hardware errors and startup issues. How To Use dmesg
...