Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. for f in *.txt;do mv ${f%txt}{txt,md}; done
- 2. for f in *.md; do mv "$f" "${f%\.md}.txt
- 3. mv $old `basename $old .txt`.md;
- 4. rename .txt .md *.txt
- 5. rename 's/.txt/.md/i' *
- 6. mmv "*.txt" "#1.md"
- 7. install mmv then use any of the following examples:
- #Rename all *.jpeg files in the current directory to *.jpg:
- # mmv '*.jpeg' '#1.jpg'
- # Replace the first occurrence of abc with xyz in all files in the current directory:
- # mmv '*abc*' '#1xyz#2'
- # Rename files ending in .html.en, .html.de, etc. to ending in .en.html, .de.html, etc. in the current directory:
- # mmv '*.html.??' '#1.#2#3.html'
- # Rename music files from <track no.> - <interpreter> - <song title>.ogg to <interpreter> - <track no.> - <song title>.ogg in the current directory:
- #
- # mmv '* - * - *.ogg' '#2 - #1 - #3.ogg'
- 8. for f in *.txt;do mv ${f%txt}{txt,md}; done
- 9. for f in *.txt; do mv $f `basename $f .txt`.md; done;
- 10. rename 's/\.txt$/\.md$/i' *
- Source: http://www.commandlinefu.com/commands/view/7351/batch-rename-extension-of-all-files-in-a-folder-in-the-example-from-.txt-to-.md
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement