...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
uname -a # Displays kernel version and system architecture.
lscpu # Provides detailed information about the CPU.
lsblk # Lists all available block devices.
lsusb # Shows USB devices connected to the system.
uptime # Shows how long the system has been running and load averages. |
Div |
---|
|
CPU and Memory Diagnostics |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
free -h
total used free shared buff/cache available
Mem: 7.7G 1.9G 3.9G 487M 1.9G 5.0G
Swap: 2.0G 0B 2.0G |
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
mpstat # Reports CPU usage. ( requires install sysstat
package via command apt install sysstat ).
Code Block |
---|
|
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
df -hmpstat
Filesystem Linux 5.15.0-112-generic (testhost) Size06/21/24 Used Avail Use% Mounted on
udev _x86_64_ (1 CPU)
10:37:12 3.8G CPU 0 %usr 3.8G %nice 0% /dev
tmpfs %sys %iowait %irq %soft 783M %steal 1.7M %guest 781M %gnice 1% /run
/dev/sda2%idle
10:37:12 all 233G 1.68 25G 197G 0.11 12% /
tmpfs 1.38 0.14 30.9G 00 39M 30.8G04 1% /dev/shm
tmpfs 1.16 0.00 0.00 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 783M 80K 783M 1% /run/user/1000 |
du -sh /path/to/directory # Displays the size of a specific directory.
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
du -sh /path/to/directory
1.1G /path/to/directory |
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 |
---|
language | bash |
---|
theme | Midnight |
---|
|
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.8G 0 3.8G 0% /dev
tmpfs 783M 1.7M 781M 1% /run
/dev/sda2 233G 25G 197G 12% /
tmpfs 3.9G 39M 3.8G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 783M 80K 783M 1% /run/user/1000 |
du -sh /path/to/directory # Displays the size of a specific directory.
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
du -sh /path/to/directory
1.1G /path/to/directory |
fdisk -l # List all partitions
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
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 |
fdisk -l # List all partitionsiostat # Reports CPU and I/O statistics ( requires install sysstat
package via command apt install sysstat ).
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
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 filesystemiostat
Linux 5.15.0-112-generic (testhost) 06/21/24 _x86_64_ (1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
1.68 0.11 1.41 0.14 1.16 95.50 |
Div |
---|
|
Process and Service Management |
...