Skip to content

Instantly share code, notes, and snippets.

@traedamatic
Last active August 29, 2015 14:24
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 traedamatic/a152e76a0aa32d5453bd to your computer and use it in GitHub Desktop.
Save traedamatic/a152e76a0aa32d5453bd to your computer and use it in GitHub Desktop.
LINUX - replace whitspaces in file names
# linux
find -name "* *" -type f | rename 's/ /_/g'
# mac with zsh
#In zsh, this is easily done with the zmv function. Put autoload -U zmv in your ~/.zshrc, or run this once in your shell, then:
# @see http://unix.stackexchange.com/questions/71690/delete-whitespace-in-filenames-in-directory
zmv '* .pdf' '${f// /}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment