Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
One-liner to remove spaces from the names of all files in the current directory
#!/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
You can’t perform that action at this time.