Disk Management Commands in Linux


 Introduction

Managing disk space is an important task for Linux users and administrators. Knowing how to check storage usage and manage filesystems helps keep the system running efficiently.


Step 1: Check Disk Usage (df)

The df command shows available and used disk space on mounted filesystems.


df -h


➡️ The -h option makes the output human-readable (GB/MB).


Step 2: Check File and Directory Size (du)

The du command reports the size of files and directories.


du -sh /home/user


➡️ This shows the total size of the /home/user directory.


Step 3: Display Mounted Filesystems (mount)

The mount command lists all currently mounted filesystems.


mount


➡️ Useful to verify which partitions or devices are mounted.


Step 4: Unmount a Filesystem (umount)

The umount command unmounts a filesystem.


umount /mnt/usb


➡️ Replace /mnt/usb with the actual mount point.


Step 5: Check Disk I/O Usage (iostat)

If installed, the iostat command provides detailed input/output statistics.


iostat


➡️ Helps monitor disk performance.


Conclusion

Disk management is vital for keeping Linux systems stable and efficient. In the next post, we will explore network management commands to check connectivity and troubleshoot network issues.

Comments