|
|
odd filenames
another problem with the cp `find results` is that it will gak on filenames with spaces or otherwise chars out of the normal char range ( [A-z][0-9] _ ). special chars in the filename need to be quoted to be passed to cp without poison.
odd filenames
Normally you would use "xargs" together with "find" to handle strange, space-filled names. However, the version of xargs shipped with MacOS X is vastly underpowered compared to the Linux [GNU] version. In the Linux version I could write:
% find . -name '*.jpg' -print0 | xargs -0 -t -i mv '{}' /path/to/new/folderbut the MacOS X version does not have the "-i" flag that lets you use '{}' as a token to represent the filename, so you would have to use perl (since there is no way to move the destination dir to the end of the "mv" command using xargs): find . -name '*.jpg' -print0 \\ | perl -0 -ne 'push @files, $_; END { print "mv \\"", join("\\" \\"", @files), "\\" /path/to/new/folder\\n"; }'Now that just prints out a nice big "mv" command for you and you can copy-and-paste your way to happiness. Anything further is left as an excercise for the reader. :-) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|