Skip to content

Instantly share code, notes, and snippets.

@mwielondek
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwielondek/83ca48130c3c90de696e to your computer and use it in GitHub Desktop.
Save mwielondek/83ca48130c3c90de696e to your computer and use it in GitHub Desktop.
Shell function for capitalizing filenames. Accepts multiple args.
# usage: `capitalize foo.txt bar.log` will rename files foo.txt bar.log => Foo.txt Bar.log
function capitalize() { for i; do echo $i | gsed -r 's/\w/\u&/' | xargs mv $i; done }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment