bash-tutorial/tutorial/rmlint.org

47 lines
1.1 KiB
Org Mode
Raw Normal View History

2022-07-18 14:23:28 +02:00
#+options: toc:nil num:nil author:nil
2022-07-03 21:06:29 +02:00
* Use rmlint to search for duplicated or empty files
** Install in Parabola GNU-linux
#+begin_example sh
pacman -S rmlint
#+end_example
** Run in the directory you want to check for duplicated or empty files
#+begin_example sh
rmlint -g
#+end_example
This will create two files:
* rmlint.sh
* rmlint.json
The shell script can be used to delete duplicated files
OPTIONS:
- h Show this message.
- d Do not ask before running.
- x Keep rmlint.sh; do not autodelete it.
- p Recheck that files are still identical before removing duplicates.
- r Allow deduplication of files on read-only btrfs snapshots. (requires sudo)
- n Do not perform any modifications, just print what would be done. (implies -d and -x)
- c Clean up empty directories while deleting duplicates.
- q Do not show progress.
- k Keep the timestamp of directories when removing duplicates.
- i Ask before deleting each file
** Execute the scripts
#+begin_example sh
chmod +x rmlint.sh
#+end_example
#+begin_example sh
bash -xcp rmlint.sh
#+end_example