Skip to content

Instantly share code, notes, and snippets.

@lewisxy
Created July 8, 2019 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewisxy/e74ea88b1b8b169b63e19f5725a6c8d1 to your computer and use it in GitHub Desktop.
Save lewisxy/e74ea88b1b8b169b63e19f5725a6c8d1 to your computer and use it in GitHub Desktop.
Shell script that replace all files with "%20" back to space in current directory
for file in *
do
if [[ "${file}" =~ (.*)%20(.*) ]]
then
mv "$file" "$(echo $file | sed "s/%20/ /g")"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment