So I have a directory that has 77 subfolders in it on my Ubuntu machine, each with various amounts of torrent files in them. Total of 427 torrents are contained in the subfolders. I want to move all of them from the subfolders into the parent directory.
The catch? Some of the files are named the exact same. When moved, it doesn't really matter what they're renamed to but the easiest way to fix it would be abc.torrent ---> abc1.torrent, abc2.torrent, and so on if there are more.
I found the following code to extract all the files to the parent directory:
find . -mindepth 2 -type f -print -exec mv {} . \;
and I understand I can use --backup to fix the files that have the same name. So I added this to the code:
find . -mindepth 2 -type f -print -exec mv --backup=numbered {} . \;
But when I run it, I only end up getting 167 files moved instead of the 427.
I also know I can use -i to ask me individually about each one, but that would take quite a long time. Is there anyway to automate this?