Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ====================================================================================
- HACKY SOLUTION TO APPENDING AN "_" to ALL FILES IN PARENT DIRECTORY AND ITS CHILDREN
- ====================================================================================
- 1. Go to parent directory. Run the following line; it will generate a script file that you can run after to append an "_" before the file extension.
- % find -iname '*.*' | while read f; do f=${f:2} ; echo mv \"$f\" \"${f/./_.}\"; done > rename.sh
- 2. Change permissions on your rename.sh file.
- % chmod u+x rename.sh
- 3. Run in parent directory.
- % ./rename.sh
- 4. Do note that you will get the following error:
- % mv: cannot stat ‘’: No such file or directory
- This is because you do not have an empty file with an empty name. Otherwise, everything should be a-ok.
- NOTE: Your script file will also have an "_" appended too.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement