4 releases
0.1.3 | Jan 16, 2021 |
---|---|
0.1.2 | Jan 16, 2021 |
0.1.1 | Dec 31, 2020 |
0.1.0 | Dec 30, 2020 |
#1599 in Filesystem
110KB
2.5K
SLoC
dsc
dsc is a command line tool for locating duplicate files. The project is heavily inspired by the fd tool.
Usage
Summary
To get a quick overview of the amount of data that is duplicated, type dsc cmp
in the current folder.
➜ dsc cmp
Duplicate data : 1.54GB
Total duplicates : 2,479
Total duplicate files : 5,164
This process can be sped up by giving a rough estimation of duplicate data by using dsc cmp --estimate
.
➜ dsc cmp --estimate --min-size 500KiB ~/git
Duplicate data : 1.07GB
Total duplicates : 234
Total duplicate files : 309
Report
For a more detailed overview use dsc report
. This will output the duplicate files in CSV (default) or JSON format.
➜ dsc report --min-size 500KiB ~/Downloads
"duplicate","identity","device","file_name","file_size"
0,0,0,"/home/user/Downloads/talon-linux (1)/talon/resources/python/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so",291681296
0,1,0,"/home/user/Downloads/talon-linux/talon/resources/python/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so",291681296
0,2,0,"/home/user/Downloads/talon-linux (2)/talon/resources/python/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so",291681296
1,0,0,"/home/user/Downloads/bloomrpc-1.3.1-x86_64(1).AppImage",189204096
1,1,0,"/home/user/Downloads/bloomrpc-1.3.1-x86_64.AppImage",189204096
Link
Use dsc link
to clean up disk space by creating hard links between files on the same devices.
➜ dsc link --dry-run ~/Downloads
Are you sure you want to link 5,164 files? [y/N]: y
Done. Reclaimed 1.54GB of disk space.
To see what is going to happen before running link you can run dsc link --dry-run
➜ dsc link --dry-run ~/Downloads
(dryrun) Are you sure you want to link 5,164 files? [y/N]: y
linking "/home/user/Downloads/bloomrpc-1.3.1-x86_64(1).AppImage" => "/home/user/Downloads/bloomrpc-1.3.1-x86_64.AppImage"
...
Other
Full help is available by typing dsc help <command>
. All commands can be listed by typing dsc
.
Dependencies
~8–18MB
~214K SLoC