Skip to content

Instantly share code, notes, and snippets.

@mark-lumbao
Created March 17, 2022 14:22
Show Gist options
  • Save mark-lumbao/63b773aa5e5e27aed61f7d6118342440 to your computer and use it in GitHub Desktop.
Save mark-lumbao/63b773aa5e5e27aed61f7d6118342440 to your computer and use it in GitHub Desktop.
Trim all whitespaces for filenames in the current directory
#!/bin/env bash
# Trim all whitespaces for filenames in the current directory
for f in *; do mv "$f" `echo $f | tr ' ' '_'`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment