What can you do if the storage on your Linux machine is nearly full? You can free up space by removing or relocating some files, and you should probably start with the biggest. Discover how to find large files and duplicates to give yourself more usable space and improve system performance.
The easy way first. QDirStat is a GUI application for the Linux desktop that you can install with this terminal command:
sudo apt install qdirstat
When you run QDirStat it will ask you to choose a directory to scan before listing the size of the directory and the files in it. You can then use the Discover > Largest Files menu item to find the biggest files. In the Locate Files window, sort them by Size and you’ll see the largest files in descending order.
You might notice that QDirStat shows some directories in red. This means that you do not have read permissions to access them.
To resolve the issue, run the program with superuser permissions like this:
sudo qdirstat
Find Large Files Using FTP Software
The FileZilla FTP app has excellent file-searching features that you can use on your local machine. Make sure that SSH is installed, or install it with:
sudo apt install ssh
Next, install FileZilla with this command:
sudo apt install filezilla
Once you’ve installed FileZilla, you can use it to search your local files:
- Open FileZilla and connect using these credentials:
Host:
localhost
Username:
Your username
Password:
Your password
Port:
22
- When you’re connected, select Server from the menu, then choose Search remote files.
- Choose the Search directory and, in the Search conditions, choose File size from the dropdown box and, for example, greater than 100MB.
- Clicking Search will show you only the files above the desired size.
You can filter the search further by adding conditions: video files with an MP4 extension, for example.
This process is also useful when you want to search for large files on a remote Linux server, particularly if you do not have access to the terminal. You will need to replace the credentials with the FTP details.
Find Large Files Using the Command Line
The quickest way to find large files is by using the find command. Here’s an example showing how to list all files above 100MB:
find . -type f -size +100M
The dot will start your search from the current directory. If you want to search from a different directory, replace the . with another path:
find /home -type f -size +100M
You can search the entire file system, with elevated privileges, like this:
sudo find / -type f -size +100M
There are a few other commands to find large files on Linux; fd, for example, is a faster alternative. But find is typically installed by default and it’s usually all you need.