Move files and skip if already in the destination in GNU Linux
Solution
Use the -n parameter when calling mv
mv -n files dest
Alternative Solution
This one-liner runs the mv command in interactive mode exept it answers no for you everytime it stops asking i you would like to overwrite the destination file.
The middle part convert yes into no statement as there isn’t any no built-in command
yes | tr y n | mv -i files dest
Replace files with the individual file names or * for all files
Replace dest with the destination folder path
Source
Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.