Skip to content

Instantly share code, notes, and snippets.

@ademidun
Last active August 10, 2019 18:39
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 ademidun/906a5d570eabeed9d59a6e7fc1b9395b to your computer and use it in GitHub Desktop.
Save ademidun/906a5d570eabeed9d59a6e7fc1b9395b to your computer and use it in GitHub Desktop.
Useful Bash and Git Commands
# Rename File Extensions
# https://www.maketecheasier.com/rename-files-in-linux/
brew install rename;
rename 's/.m4a/.mp3/' * # rename all .m4a files to .mp3 (don't forget to include the asteriks '*')
# delete all files with a certain extension
# https://askubuntu.com/questions/377438/how-can-i-recursively-delete-all-files-of-a-specific-extension-in-the-current-di
find . -name "*.bak" -type f #first check the files that will be deleted
find . -name "*.bak" -type f -delete # then you can delete them
# UNDO a commit
git reset --soft HEAD~1
git reset --hard HEAD~1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment