Created
July 28, 2017 02:17
-
-
Save rvighne/b6affd7ef5a231ed70e46a885360e248 to your computer and use it in GitHub Desktop.
Bash shortcuts that I always find useful. Source it from your .bashrc so it is always available (on Ubuntu, you can simply name it ~/.bash_aliases)
This file contains hidden or 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
# When the given command terminated, run it again unless interrupted | |
retry() { | |
while :; do | |
"$@" | |
tput bold; tput setaf 1 | |
echo "Retrying $1 (Ctrl-C to cancel)" | |
tput sgr0 | |
sleep .5 | |
done | |
} | |
# Create a directory, then change into it | |
mkcd() { | |
mkdir $1 | |
cd $1 | |
} | |
# Remove the current directory, and end up in the parent directory | |
rmcd() { | |
cd .. | |
rm -r $OLDPWD | |
} | |
# Shorter way to shutdown | |
off() { | |
sudo shutdown -h now | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment