gdu icon indicating copy to clipboard operation
gdu copied to clipboard

Is possible to add feature to remove all hardlinks?

Open WMP opened this issue 2 years ago • 1 comments

I have many files for which many hardlinks are created. gdu I use to clear disk space. When I press d to delete a file, there is no more space on the filesystem because it is a hardlink, and I have to delete all hardlinks to make more space on the disk. Is it possible to add a switch in gdu, which activates the option of deleting all hardlinks, instead of just one hardlink?

WMP avatar Jul 29 '23 17:07 WMP

It's not an exact match for what you're asking for, but the tool rmlint might be able to address some of your needs here. By default it will identify two hard links to the same file as duplicates.. so it could find those for you... I might use rmlint -gfor progress meter, and possibly add -F if you want it to ignore symbolic links. It doesn't take action when you run it.. it generates a .json file and a .sh script with the results. The script will, by default, delete the duplicates, but you can use more command line options to have it do other things. I just read the script... scroll the first ~7 pages or so of the script is all helper functions.. then the list of original/duplicates is after all that.

namespacebrian avatar Mar 04 '24 16:03 namespacebrian