jdupes icon indicating copy to clipboard operation
jdupes copied to clipboard

Set order by full path depth?

Open dzg opened this issue 4 years ago • 1 comments

Is there any way to set the order of results by the path "depth" of the item? So that deeper items get deleted first?

I.e., given

a/bb/ccc/foo
b/cc/foo
c/dd/eee/fff/foo

I want to keep b/cc/foo and delete the rest, because it's closest to root folder.

dzg avatar Aug 06 '21 23:08 dzg

If you are on Linux/Mac or can use the MSYS2 environment on Windows, this would be a good use for a custom shell script; there is a directory of example scripts with plenty of documentation in the source code. What you need to do is count the number of slashes, then sort by that count. Watch out for relative paths. Stack Overflow is your friend.

I could possibly add this as a feature in the future. I'll leave this open.

jbruchon avatar Aug 07 '21 00:08 jbruchon