Skip to content

Instantly share code, notes, and snippets.

@IamPhytan
Created September 9, 2019 00:33
Show Gist options
  • Select an option

  • Save IamPhytan/7fc5c4d061038b36dca5ab77730ff17d to your computer and use it in GitHub Desktop.

Select an option

Save IamPhytan/7fc5c4d061038b36dca5ab77730ff17d to your computer and use it in GitHub Desktop.
Append text to filename
FOLDERPATH=RandomFolder
APPENDTEXT=_TextToAppend
for name in $FOLDERPATH/*;
do SUBSTRING=${name%.*};
ext=${name##*.};
mv $name $FOLDERPATH/${SUBSTRING##*/}$APPENDTEXT.$ext
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment