Introduction

The Linux command line offers powerful tools for system administration, file management, and productivity. In this comprehensive guide, we'll explore essential commands for monitoring disk usage, time-saving keyboard shortcuts, file searching techniques, and system process management.

Monitoring Disk Usage with df and du

Understanding Disk Space with df

One of the most fundamental tasks in system administration is monitoring disk space. The df command provides a quick overview of your system's disk usage:

df

This command outputs drive usage information, but the raw output can be difficult to interpret. The key line to focus on is the one showing / (the root directory), which represents your entire hard drive in Linux systems.

For a more readable format, use the human-readable flag:

df -h

This displays disk usage in familiar units like gigabytes (GB) and megabytes (MB). For example, you might see output showing 14GB used and 39GB available, giving you an immediate understanding of your storage situation without navigating through file explorers or system properties.

Analyzing Directory Sizes with du

While df shows overall disk usage, du (disk usage) helps identify which directories are consuming the most space:

du -h

This command recursively examines all folders in your current directory, showing the space each one occupies. However, the recursive nature can make output overwhelming for large directory structures.

For a cleaner summary view, use:

du -sh *

This combination of flags provides: