Skip to content

Instantly share code, notes, and snippets.

@andreyshuster
Created September 18, 2022 17:37
Show Gist options
  • Save andreyshuster/0adf582163276020914d659d7dffd9c4 to your computer and use it in GitHub Desktop.
Save andreyshuster/0adf582163276020914d659d7dffd9c4 to your computer and use it in GitHub Desktop.
replace spaces with dashes if filenames
# delete first echo for real results
for file in *; do echo mv "$file" "$(echo $file | sed 's/ - /_/g ; s/ /-/g')" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment