👨💻 about me home CV/Resume News 🖊️ Contact Codeberg Github LinkedIn 🏆 Best of LuaX (tools) pub bang ypp panda lsvg ldc yreq Fizzbuzz Calculadoira TPG picfg Belenos (intro) 🔀 Git Repos
Made in Europe
dedup is a tool that searches for duplicate files in a
set of directories. It helps you easily identify identical files to free
up disk space.
$ git clone https://codeberg.org/cdsoft/dedup
$ cd dedupFirst generate the Ninja build file:
$ bangThen dedup can be installed in ~/.local/bin
with:
$ ninja installOr just compiled in the .build directory with:
$ ninjadedup [options] directories
--hidden--skip-hidden--safe--fast--stats--help or -hdedup won't modify the file system. It just prints the
list of duplicate files on the standard output (stdout).
Its output can be redirected to a script and modified to, for example,
delete some files.
# Search for duplicates in the Photos directory
$ dedup ~/Photos > duplicates.sh
# Edit the script to choose which files to delete
$ nano duplicates.sh
# Run the script to delete the selected files
$ sh ./duplicates.shWarning
The output is a shell script which deletes all the duplicate files. All lines are commented by default. The user can uncomment some lines to delete files. If you uncomment all lines, all files will be deleted. It's up to you to wisely choose which lines to uncomment!
The output of dedup is organized in blocks of identical
files. Each block starts with the filename and its size, followed by the
list of duplicate files. At the end, dedup displays the
total space that could be freed.
Example output:
# image.jpg (2.5 Mb)
# rm "/home/user/Photos/2023/image.jpg"
# rm "/home/user/Photos/Backup/image.jpg"
# rm "/home/user/Documents/image.jpg"
# document.pdf (1.2 Mb)
# rm "/home/user/Documents/document.pdf"
# rm "/home/user/Downloads/document.pdf"
# Lost space: 6.2 Mb
dedup uses several steps to identify duplicate
files:
--safe mode, comparing the complete content of
filesThis approach optimizes detection speed while maintaining good accuracy.
The configuration files are in $HOME/.config/dedup/.
$HOME/.config/dedup/dedup.ignorededup.ignore
FileEach line in the dedup.ignore file contains a glob
pattern that will be used to exclude files or directories. For
example:
*.tmp
.git
node_modules
This configuration will ignore all .tmp files,
.git and node_modules directories.
$ dedup --safe ~/Photos > photo_duplicates.sh$ dedup ~/Documents ~/Downloads ~/Desktop > duplicates.sh$ dedup --hidden ~ > hidden_duplicates.sh--safe option for important files to avoid
false positivesdedup is slow on large directories, use the
--fast and --skip-hidden optionsThis file is part of dedup.
dedup is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dedup is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dedup. If not, see <https://www.gnu.org/licenses/>.
For further information about dedup you can visit
https://cdelord.fr/dedup
This site is powered by LuaX, bang, ypp, cdsoft.css and Pandoc.
Mirrors: cdelord.fr – christophe.delord.free.fr – cdsoft.codeberg.page