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:
just an alternative to #7818
There is 1 alternative - vote for the best!
Instead of tedious manual mv commands and tabbing, this routine creates a file listing all the filenames in the PWD twice, edit the second instance on each line to the new name, then save the file, the routine does the rest. Feel free to replace nano with your holy war editor of choice.
You will get a lot of "mv: 'x' and 'x' are the same file" warnings, these could be cleaned up but the routine works.
If you can do better, submit your command here.
You must be signed in to comment.