Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Linux offers a variety of command-line tools to monitor, analyze, and manage disk usage and structure. These tools help in identifying storage bottlenecks, understanding directory hierarchies, and managing disk space efficiently.
Displays disk space usage for file systems.
Syntax: df [options]
Example:
df -h # Outputs disk usage in a readable format.
Key Options:
Syntax: du [options] [path]
Key Options:
-h: Human-readable format.
-s: Summary of total size.
--max-depth=N: Limits output depth.
Example:
du -h --max-depth=1 /home
Displays sizes of directories under /home.
Analyzes disk space used by directories or files.
Interactive disk usage viewer (alternative to du).
Usage:
Navigate with arrow keys.
Delete files directly (requires confirmation).
Example:
ncdu /home
Launches an interactive view of /home.
Lists information about block devices (e.g., disks, partitions).
Syntax: lsblk [options]
Key Options:
-f: Displays file system information.
-o NAME,SIZE,TYPE,MOUNTPOINT: Customize output.
Example:
lsblk -f
Shows all block devices and their file systems.
Displays UUIDs and file system types of block devices.
Example:
blkid
Lists all available partitions with UUID and file system type.
Displays directories as a tree structure.
Syntax: tree [options] [directory]
Key Options:
-d: Show only directories.
-L N: Limit depth of directory traversal.
Example:
tree -L 2 /home
Displays /home structure up to 2 levels.
Shows currently mounted file systems in a tree format.
Syntax: findmnt [options]
Example:
findmnt
Outputs mounted file systems with details.
Disk partitioning tool with detailed disk information capabilities.
Example:
parted -l
Lists all disks and partition details.
Provides CPU and I/O statistics.
Example:
iostat
Shows device-level disk I/O statistics.
Lists open files, including disk usage.
Example:
lsof +D /path
Displays open files in a specific directory.
Example:
du -ah / | sort -rh | head -n 10
Shows the top 10 largest files/directories.
Check disk usage per user:
du -sh /home/*
tree -sh /path