Last active
August 10, 2019 18:39
-
-
Save ademidun/906a5d570eabeed9d59a6e7fc1b9395b to your computer and use it in GitHub Desktop.
Useful Bash and Git Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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