Introduction
ncdu (NCurses Disk Usage) is a simple yet powerful command line tool that offers a detailed view of disk usage, enabling users to navigate through directories and clean up their disk space interactively. It's an improvement over the traditional du command, providing a user-friendly interface and additional features for sorting and deleting files directly from its interface.

Analyze and Manage Disk Space
To start using ncdu for a full system disk usage analysis, enter the following command into terminal:
ncdu /

This command initializes ncdu at the root directory, allowing you to analyze the disk usage of your entire filesystem. Once ncdu is running, you will see a textual user interface listing all files and directories in the root, along with their sizes.
Basic Operating within Ncdu
- Navigation: Use the
upanddownarrow keys orjandkto cycle through the items. Use therightarrow orenterto open a selected directory, and theleftarrow to return to the parent directory. - Sorting: Press
sto sort items by file size,nfor name,Cfor number of items, orMfor modified time. Press the same key again to toggle ascending and descending order. - Viewing Options:
- Toggle between disk usage and apparent size by pressing
a. - Change the display mode by pressing
gto show percentage, graphical representation, both, or none. - Press
cto toggle the display of child item counts, andmfor the latest modified time of child items (requires the-eflag).
- Toggle between disk usage and apparent size by pressing
- Deleting Files: Press
dto delete the selected file or directory. You will receive a confirmation prompt to prevent accidental deletions. - Additional Utilities:
- Press
ifor detailed information about the selected item. - Press
bto spawn a shell in the current directory. This can be customized with theNCDU_SHELLenvironment variable. - Press
rto refresh or recalculate the current directory.
- Press
- Exiting: Press
qto exitncduand return to the command line.
Using ncdu from the root directory provides a comprehensive overview of where disk space is being utilized across your entire system, making it easier to perform cleanups and maintain efficient storage practices.
Summary
ncdu provides a highly interactive and intuitive way to analyze disk space usage on Linux systems. It offers a significant improvement over traditional methods, making it easier to identify and manage space hogs within your file system. By integrating ncdu into your regular system maintenance routines, you can efficiently manage disk space and keep your system clean and organized.



