Skip to content

Instantly share code, notes, and snippets.

@belkarx
Created July 20, 2022 21:07
Show Gist options
  • Save belkarx/d23d60b098d30ce445d3c28290d73b81 to your computer and use it in GitHub Desktop.
Save belkarx/d23d60b098d30ce445d3c28290d73b81 to your computer and use it in GitHub Desktop.
whatever_whatever2.txt -> whatever.txt
find . -type f -exec sh -c 'x="{}"; mv "$x" "$(echo $x | cut -d_ -f1)".txt' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment