commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This will make a false directory with the same file names as whatever directory you choose. This is wise to use when testing scripts that alter contents, filenames, or move files. I wrote this after an OOPS I made when renaming a directory of JPGs, PNGs, PSDs that were mixed. I recommend this as I lost over 2000 vacation pictures and some graphics I designed for software and web sites. :(
NOTE: This only creates name copies, that data itself is not copied.
There are 7 alternatives - vote for the best!
You could avoid xargs and sed in this case (shorter command and less forking): At least bash and zsh have some mighty string modifiers.
I would also suggest using find with exec option to get more flexibility. You may leave out or include "special" file for example.
If you can do better, submit your command here.
You must be signed in to comment.