I have a file system tree and on different locations within it are files with the same name. I tried the following command on the command line:
find / -name "HAHA" -exec mv {} /home \;
It only worked for one file, for the others I received an error message for having the same name.
Can I change the command in a way that for each file name a number will be attached to distinguish them?
Best Answer
I found a simple solution with a small script. The script is called
cpf
(or whatever name you give it) and is as follows:You execute the command as follows: