I have a large directory 'Pictures' that has a lot of individual sub directories, each with varying number of image files in them. I want to move every file that is in sub directories into a single, consolidated directory.
One challenge to overcome is that there are many files with the same name in various sub directories. i.e. Pictures/Subdir1/dsc_001.jpg, Pictures/Subdir15/dsc_001.jpg, Pictures/Subdir120/dsc_001.jpg
Since I want to keep both, I attempted to use the backup flag in a find one-liner, like so:
find . -type f -exec mv --backup=t '{}' /media/DATA-HDD/AllImages \;
However, upon testing, all source files move, but no renaming happens. I just have a single file which happens to be whichever file was moved last. I also tried using cp in the same manner, but same results.
Running Ubuntu 20.04 on this VM.
I have checked the man for coreutils and this is what it says to do, so not sure why it isn't working as planned.
.~1~
suffixmv --help
mv --help
will expose whichmv
is installed. for example on my android busyboxmv
doesn't support that--backup
flag (so man page doesn't always fit your environment)