Linux fdupes: Get Rid (Delete) Of Double Duplicate Files In Directory

fdupes is a Linux utility that helps you to find and list duplicate files in a directory. You can use fdupes to find and remove duplicate files to free up disk space.

To get rid of double duplicate files in a directory using fdupes, follow these steps:

  1. Install fdupes if it’s not already installed on your system. You can do this by running the following command:
sudo apt-get install fdupes
  1. Navigate to the directory where you want to find and remove duplicate files. For example, if you want to find duplicate files in the “Documents” directory, you can run the following command:
cd ~/Documents
  1. Run the fdupes command with the “-r” option to search for duplicate files recursively in subdirectories. For example, to search for duplicate files in the current directory and all subdirectories, you can run the following command:
fdupes -r .

This command will list all the duplicate files in the current directory and its subdirectories.

  1. Review the output of the fdupes command to ensure that it has identified only the duplicate files that you want to remove.
  2. To remove the duplicate files, you can use the “-d” option with the fdupes command. For example, to remove all the duplicate files in the current directory and its subdirectories, you can run the following command:
fdupes -d -r .

This command will prompt you to select which files to keep and which to delete.

  1. Once you have selected which files to delete, fdupes will remove them from the directory.

Note that you should always review the output of the fdupes command carefully before deleting any files to ensure that you don’t delete important files by mistake.

Leave a Comment