Created
April 7, 2014 15:22
-
-
Save benwells/10022347 to your computer and use it in GitHub Desktop.
Batch renaming files in a directory using bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Batch renaming/mv/cp/etc... using bash | |
# Step 1: to make a backup copy of all pdf files in a directory | |
for i in *.pdf ; do mv "$i" "${i}.backup" ; done | |
# Step 2: to copy one file over all of the original files in this directory | |
for i in *.pdf ; do cp "~/source.pdf" "${i}" ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment