Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save arjenvanderende/4556414 to your computer and use it in GitHub Desktop.

Select an option

Save arjenvanderende/4556414 to your computer and use it in GitHub Desktop.
Changes the filename of each file in the current directory, so spaces are replaced with underscores.
for name in *.*; do new_name=$(echo $name | sed 's/ /_/g'); mv "$name" $new_name; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment