Skip to content

Instantly share code, notes, and snippets.

@brunogama
Created May 14, 2025 12:21
Show Gist options
  • Save brunogama/e95d6cbf808824c1993bd265112731ad to your computer and use it in GitHub Desktop.
Save brunogama/e95d6cbf808824c1993bd265112731ad to your computer and use it in GitHub Desktop.
lowerc case and snake case all files shell
for f in *; do new=$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/_/g' | sed -E 's/^_|_$//g'); if [ "$f" != "$new" ]; then mv "$f" "$new"; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment