Skip to content

Instantly share code, notes, and snippets.

@movesmyers
Created July 19, 2013 13:07
Show Gist options
  • Select an option

  • Save movesmyers/6038990 to your computer and use it in GitHub Desktop.

Select an option

Save movesmyers/6038990 to your computer and use it in GitHub Desktop.
replace all spaces in all filenames with underscores in working directory
ls -1 *.avi | while read file; do new_file=$(echo $file | sed s/\ /_/g); mv "$file" "$new_file"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment