Last active
August 29, 2015 14:26
-
-
Save itsmunim/3791998302ad219b51ad to your computer and use it in GitHub Desktop.
Rename all the folders inside current folder(where this shell script will reside) with a specified suffix.
This file contains 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
for FILENAME in * | |
do | |
a="$FILENAME" | |
if [[ $a != *"$1"* && -d "$a" ]] | |
then | |
mv "$a" "$a$1" | |
else | |
"Not renaming $a" | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rename all the folders inside current folder with a specified suffix. Call Format :
./rename_dirs Suffix
N.B. Give it execution permission beforehand -
chmod +x rename_dirs.sh