6.8 Disk and Storage Commands
df -h # disk space per mounted filesystem (human readable)
df -Th # include filesystem type (xfs, ext4)
sudo du -sh /var/log # total size of a folder
sudo du -h --max-depth=1 /var | sort -h # which sub-folder is big?
lsblk # block devices (disks & partitions) as a tree
lsblk -f # with filesystem type, UUID and mount point
sudo blkid # UUIDs of all filesystems
findmnt / # what is mounted at /
sudo mount /dev/nvme1n1 /data
sudo umount /data
cat /etc/fstab # permanent mounts (read at boot)
free -h # memory
Ravindra Bagale's Tip
Disk 100% bharla ki MySQL aani Nginx vichitra errors detat aani khup students code madhe problem shodhat bastat. Kahi vichitra zala ki aadhi df -h bagha. Motha folder shodhayla du -h --max-depth=1 | sort -h.
Practice task
Show free disk space, the size of /var/log, the three largest folders under /var, and the block devices with lsblk -f.