Disk Space Usage
Show disk space.
df -h
df -h /home
df -iDirectory Size
Calculate directory size.
du -sh directory/
du -h --max-depth=1
du -sh * | sort -hMount Filesystem
Mount partitions.
mount /dev/sdb1 /mnt
mount -o ro /dev/sdb1 /mnt
mount | column -t
Unmount
Unmount filesystems.
umount /mnt
umount -f /mnt
umount -l /mntDisk Partitions
Partition management.
fdisk -l
sudo fdisk /dev/sdb
parted /dev/sdbCreate Filesystem
Format partitions.
mkfs.ext4 /dev/sdb1
mkfs.xfs /dev/sdb1
mkfs.vfat /dev/sdb1Check Filesystem
Verify and repair.
fsck /dev/sdb1
e2fsck /dev/sdb1List Block Devices
Show all block devices.
lsblk
lsblk -fCommon mistakes / Errores comunes
- People often copy a command or pattern without adapting placeholders, which can break production workflows unexpectedly.
- It is easy to forget environment-specific differences, so always verify behavior in your shell, runtime, or API gateway before shipping.
- Many errors come from skipping small validation steps, so test with realistic sample input before relying on the result.
Last updated: February 2026