Skip to content

Instantly share code, notes, and snippets.

@puryfury
Created May 24, 2021 13:14
Show Gist options
  • Select an option

  • Save puryfury/3abf9f458e3e7fbb1e87bee32d833da6 to your computer and use it in GitHub Desktop.

Select an option

Save puryfury/3abf9f458e3e7fbb1e87bee32d833da6 to your computer and use it in GitHub Desktop.
A one-liner shell that rename original file name from URL encoded file name.
# rename uel encoded file to original from files start with '%' in current directory.
for old in \%*; do new=$(echo $old | sed "s@+@ @g;s@%@\\\\x@g" | xargs -0 printf "%b"); mv -- "$old" "$new"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment