2012-01-18, 04:23
...or I suspect it will be easy for you folks. I'm simply trying to do the following:
Go through all my TV folders and do two copy/renames within each folder:
copy all folder.jpg to banner.jpg
copy all poster.jpg to folder.jpg
I've trying various different things but am struggling, likely because my folders have spaced in them (e.g. /mnt/user/My TV/Family TV/Dinosaur Train).
The script I've ben using are:
find . -name folder.jpg -print0 | xargs -0 -i cp --preserve ./{} ./banner.jpg
find . -name poster.jpg -print0 | xargs -0 -i cp --preserve ./{} ./folder.jpg
but they fail when run from the parent directory. Just grabs the first one it finds and drops it in the parent directory rather than recursively making the copies in each directory.
Here are the internet samples I was going off, but they're not exactly what I was looking for:
find . -name '.AppleDouble' -printf '"%p"\n' | xargs rm -Rf
find /originalPath/ -name *.mp3 -print0 | xargs -0 -i cp ./{} /destinationPath/
I'm sure this would be a snap for you UNIX gurus. Much appreciate any help!
Go through all my TV folders and do two copy/renames within each folder:
copy all folder.jpg to banner.jpg
copy all poster.jpg to folder.jpg
I've trying various different things but am struggling, likely because my folders have spaced in them (e.g. /mnt/user/My TV/Family TV/Dinosaur Train).
The script I've ben using are:
find . -name folder.jpg -print0 | xargs -0 -i cp --preserve ./{} ./banner.jpg
find . -name poster.jpg -print0 | xargs -0 -i cp --preserve ./{} ./folder.jpg
but they fail when run from the parent directory. Just grabs the first one it finds and drops it in the parent directory rather than recursively making the copies in each directory.
Here are the internet samples I was going off, but they're not exactly what I was looking for:
find . -name '.AppleDouble' -printf '"%p"\n' | xargs rm -Rf
find /originalPath/ -name *.mp3 -print0 | xargs -0 -i cp ./{} /destinationPath/
I'm sure this would be a snap for you UNIX gurus. Much appreciate any help!