Here are mine.
1. yeet (delete) the directory and all it's contents.
alias yeet="rm -rf"
2. quickly move one or two directory up in bash.
alias ..="cd .."
alias ...="cd ../.."
3. [function] Extract files from any archive. (stolen from Manjaro's Default bashrc)
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
Please do not forget to share yours.
Top comments (3)
The only use case I have for
du
For directory navigation I prefer numbers.
Some shortcuts for common
tmux
commandsThat last one uses: gone.
And some cool key bindings. I put these in a
.inputrc
file in my home.This changes the behavior of the Up and Down arrows, if you have some text in your prompt it will perform a search using that text. Is like a "prefix search". Let's say I have these three commands in my history.
If you start writing
vi
and then hit the Up arrow it will only cycle through the commands that start withvi
. In this case it will skipnvim
and the one that hasvi
in the middle.If you are not a fan of changing the arrow keys behavior I suggest using these.
You can find more aliases and functions on my dotfiles.
I'll steal you directory navigation aliases.
alias psg="ps -ef| grep"
alias update="sudo apt update && sudo apt upgrade -y && sudo snap refresh"
alias adios="update && sudo shutdown"
alias ltr="ls -ltr"
alias h="history | grep "