command to find and move jpg's
Hello
I have searched the forum but am trying to find the command that will search through a folder with loads of sub folders through several layers and move all jpeg/jpg to another new folder and maybe rename any duplicate images/names..all folders are on an external hd Many thanks |
Quote:
Code:
man find Quote:
|
I only meant rename duplicate images in the context of the same named file in different folders - not the image itself.
|
Quote:
man comm man sort man mv man rename Make 2 lists of files, one for each directory, then compare them. You can list all .jpg in dir with Code:
var1=$(ls *.jpg) Code:
list1=" |
I have been trying to get this to work -
find / -Folder1 "*.jpg" -type f -exec /bin/mv {} /Folder2/jpg \; |
The path must come first, before any of the options. Try this:
Code:
find /Folder1 -type f -name "*.jpg" -exec /bin/mv {} /Folder2/. \; Code:
find /Folder1 -type f \( -name "*.jpg" -o -name "*.jpeg" \) -exec /bin/mv {} /Folder2/. \; |
Folder1 and Folder2 are both on my desktop
mint@mint-HP-Pro3500-Series:~/Desktop$ find . -type f \( -Folder1 "*.jpg" -o -iname "*.jpeg" \) -exec cp '{}' /Folder2 \; find: unknown predicate `-Folder1' mint@mint-HP-Pro3500-Series:~/Desktop$ find /Folder1 -type f -name "*.jpg" -exec /bin/mv {} /Folder2/. \; find: ‘/Folder1’: No such file or directory mint@mint-HP-Pro3500-Series:~/Desktop$ find /Folder1 -type f \( -name "*.jpg" -o -name "*.jpeg" \) -exec /bin/mv {} /Folder2/. \; find: ‘/Folder1’: No such file or directory |
Then use whichever absolute path is appropriate for find and mv
Code:
find /home/smokeyone/Desktop/Folder1 -type f -name "*.jpg" \ |
Thank you very much for the help
|
No problem.
Once you have it working, I'd recommend taking another look at the manual page and reviewing the options you just used: Code:
man find |
Thanks for the suggestion - I will get to grips with man find -
Thanks again for the help |
All times are GMT -5. The time now is 05:40 AM. |