Your hard drive likely contains a large number of files, many of them copies you've accumulated over time, and you may not remember if you've already saved them. The same applies to USB drives or external hard drives, where you keep backing up your data, and they eventually fill up with numerous duplicates . But they also probably contain temporary files, cache, and other useless junk.
If you want to automatically locate and delete duplicate files , as well as remove unnecessary files to free up space and make room for other things, Linux offers several quick ways to do this. This will save you from having to delete other useful files from your storage or from having to buy more and more disks to store all the data you generate.
Keep in mind that a disk likely contains hundreds or thousands of directories, with thousands or millions of files. It's impossible to go through them one by one and remember which ones you've seen to check for duplicates, nor is it possible to know all the directories where all that unused data is typically stored . That's why it's best to leave it to the tools...
- Locate and remove duplicates: one of the most frequent problems is duplicates. Images, videos, and many other types of files that may be duplicated on your media. To locate them I recommend an easy and intuitive tool such as FSlint that you can install from the Software Center of your distro or from the repositories with the package manager of your distro. Although if you prefer the terminal, there are others such as fdupes, rfind, etc., but you must use them carefully if you don't want to delete what you don't want ... With FSlint you just have to:
- Open the app.
- Click on the Add button and select the folder or disk that you want to analyze to search for duplicates.
- If there is another previously added route where you don't want to search, you can select it and press Remove.
- Select the Recursive option if you want it to also search the subdirectories that that drive or directory may contain.
- Once you have it, press Search to start the analysis. Depending on the size of the drive and the number of files, it may take longer or shorter. If it's a big album, you can go while doing something else, since it will take ...
- When it finishes you will see that it shows the list of duplicates it has located. If you click Select, it selects them all. You can go one by one leaving it checked or deselecting it if you want to keep it.
- Once only the ones you want to delete are marked, click Delete to delete them.
- Eliminate nuisance waste: You must install the Bleachbit app on your system. Once installed, its use is very simple. You can mark all the fields that you want to remove. Then click on Clear so that it begins to erase everything that you have marked. I personally usually delete the following:
- Mark your package manager so that it removes all those packages, caches and lists that have been stored when you have installed or updated and they are no longer useful. For example, if you work with Debian and derivatives, you will see an entry called APT and several suboptions. Check all.
- I don't usually delete Bash history, because I use it, but if you don't use it, you can mark it as well.
- The Deep Scanner is recommended only if you know what you are doing, also, if you mark it, it could take forever ... That is why I prefer not to mark it, and in any case I do it manually in other maintenance tasks. In addition, some of the options are aimed at a disk that is shared or has belonged to Windows, since it looks for the happy Thumbs.db that the Microsft system generates in some folders with multimedia files. But if it is not your case, do not select it.
- Browsers, if you have one or more browsers, as well as other programs that generate cache or temporary, such as mail clients, etc., mark everything if you know what you are doing. Otherwise, don't do it or check only certain fields. For example, your Firefox may have passwords, web settings, and forms that you want to keep for convenience. Instead, it is likely that the cache, history, and cookies do want to remove them.
- Finally, the System section does not recommend that you check it (at least everything) if you do not know what you are doing. You could delete temp, cache, trash and clipboard if you don't use it. But, for example, the logs you might need to query, etc.
- Old kernels: Another thing that can take up a lot of space is if you have several old kernel images installed that you don't use. If you have compiled a new kernel, you should not delete the old one so that the system can boot with the functional one in case the new one does not work. There are also some who for development reasons or any dependency need to work with several at the same time. But in most cases, normal users don't need multiple kernels. Although you can do it from the command line, if you are a newbie you may not know very well how. In that case I advise you the following:
- Ukuu: it is an app with a simple graphical interface to manage your kernels in Ubuntu, although it is no longer in use, it is no longer being developed, but it continues to work. You will see the list of kernels that you can select and Remove if you don't want them. Be careful not to delete the one you use!
- KittyKernel: similar to the previous one, with a simple GUI with which you can manage the kernel versions you have installed to eliminate what you don't need.