Created
June 6, 2013 17:28
-
-
Save arirusso/5723281 to your computer and use it in GitHub Desktop.
One-liner to remove spaces from the names of all files in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Remove spaces from the names of all files in the current directory | |
# | |
ls -1 | 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