/ All / Categories /

Broom

I`ve come to understanding that I`m qite a bit of a hoarder myself.

Images, videos and other NECESSITIES are piling up and day by day fill up more and more of my disk space to the point when I need to take measures before the sessions of transferring my precious homework folder to the other devices with ftu start to last more than 60 minutes.

The collected MUST BE PRESERVED AND PASSED TO NEXT GENERATIONS after all, so keeping copies is essential...

Sadly, there is no magic in this world so I need to improvise and somehow reduce the actual size of the said folder. My choices are:

  1. Remove some precious files
  2. Archive the whole thing
  3. Stop hoarding, man !
  4. Remove duplicates while saving the structure
While the first 3 are viable solutions, I`d still rather preserve what I`ve collected, not spend time archiving<->unarchiving and still hoard !

So, the problem is solved, right ? Just find some nice free and open-source duplicate remover and continue to collect to your heart`s content ! - NO, we do not do that here. The bicycle must be reinvented once again !


Broom is a command line utility to locate and manage duplicate and empty files in the desired directory.

Installation

"Compile it yourself" way

  1. clone the repository
  2. git clone https://unbewohnte.su:3000/Unbewohnte/broom
  3. compile manually or with cmake (in build/ run:)
  4. cmake .
    cmake --build .

Compiled binary for your platform will be in the newly created bin directory, you are free to put it wherever you desire.

If you're on GNU/Linux - you can run install.sh for broom to become system-wide accessible.

"The lazy" way

  1. proceed to the releases page and get yourself a pre-compiled binary

Usage

broom [FLAGS..] [COMMAND] [DIRECTORY]

[FLAGS]

-v or --version -> print version information and exit

-h or --help -> print this message and exit

-od or --output-directory -> path to the directory to save results file in

[COMMANDS]

sweep -> scan for duplicate files, REMOVE empty files and REPLACE other duplicates with symlinks

scan -> scan and save results in a file without removing anything [DEFAULT]

[DIRECTORY] is the path to the directory that will be searched for duplicate files


Examples

broom scan -od . ~/homework

broom sweep ~/homework

After the scan the results file will be saved in your current working directory, unless you specified it to be somewhere else. Scan results file contains a list of duplicate files that are grouped together so you can see EXACTLY WHERE each duplicate is in the filesystem.


~500MB of duplicates removed. Quite nice.

Code is:

[Categories:Programming,Utilities:] [Date:January 2022, August 2022:]