Yesterday I had to put down these two lines of script under Linux to copy me all the images in all subfolders I had in a directory. I do not guarantee full compatibility on OSX, although in theory it should work OOB.
The first step renames all files by removing the case, the second making the copy. Change only "backup_data" putting the absolute path the copy destination.
find. -Depth-exec rename 's /(.*) \\ / ([^ \\ /]*)/$ 1 \\ / \\ L $ 2 /' {} \\;
find. -Depth-name "*. jpg"-execdir cp {} / backup_data / {} \\;
You can run the code from the command line or copy the lines below into a file, give it execute permissions (chmod + x filename) and run
# / bin / bash echo
"Renaming ...."
find. -Depth-exec rename 's /(.*) \\ / ([^ \\ /]*)/$ 1 \\ / \\ L $ 2 /' {} \\;
echo "Copying ..."
find. -Depth-name "*. jpg"-cp execdir {} / Backup_data / {} \\;
echo "Done"
No comments:
Post a Comment