You can use ncdu
(NCurses Disk Usage), a command-line utility for Linux-based systems, like Ubuntu, that helps users quickly analyze disk space usage by providing an easy-to-navigate interface. It displays directories and subdirectories sorted by their size, making it simple to identify large subdirectories.
To use ncdu in Ubuntu, follow these steps:
Install ncdu: If you haven't already installed ncdu, open the terminal and run the following command to install it:
sudo apt-get update
sudo apt-get install ncdu
Navigate to the directory: Use the cd command to navigate to the directory you want to analyze. For example, to analyze your home directory, you can use:
cd /home/your_username
Replace your_username with your actual username.
Run ncdu: Once you're in the desired directory, run the ncdu command to start analyzing disk usage:
ncdu
The utility will start scanning the directory and its subdirectories. This process may take some time, depending on the size of the directories.
Navigate the ncdu interface: Once the scanning is complete, you'll see an interactive, ncurses-based interface displaying the directories and subdirectories sorted by their size, from largest to smallest. You can navigate this interface using the arrow keys, Enter, and the following keyboard shortcuts:
q: Quit ncdu and return to the terminal. r: Recalculate the current directory. s: Sort the items alphabetically by name. S: Sort the items by size (default). d: Delete the selected directory or file (be cautious when using this option). ?: Show help screen with a list of available commands. With ncdu, you can quickly and easily identify the largest subdirectories within a directory, helping you manage your disk space more effectively.