By Rajat Goyal
@rajat404
bash
& ksh
replacement text for a command
# Git Aliases
alias gs="git status"
alias ga='git add . --all'
alias gb='git branch '
alias gc='git commit -am'
alias gk='git checkout'
alias gpo='git push origin "$(git-branch-current 2> /dev/null)"'
alias gpu='git pull origin "$(git-branch-current 2> /dev/null)"'
alias fsize="du -hs * | sort -h"
alias lookup='ps aux | grep'
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to clipboard.'"
alias pwc="pwd | pbcopy | pwd && echo '=> Current Directory copied to clipboard.'"
alias las="ls -SFhsrl"
alias env="python3 -m venv venv"
alias sv="source venv/bin/activate"
alias mp3="youtube-dl --extract-audio --audio-format mp3 --no-playlist"
alias youtube-720="youtube-dl -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' --no-playlist"
Group or modify commands for easy execution
# http://hamberg.no/erlend/posts/2013-01-18-mkcd.html
mkcd(){
mkdir -p "${1}"
cd "${1}"
}
# Automatically do `ls` after `cd`
cd(){
builtin cd "$@" && ls -F
}
req(){
pip freeze | grep "$1"
pip freeze | grep "$1" | pbcopy
echo "=> Output copied to clipboard"
}
# Create Archives
mktar() { tar cvf "${1%%/}.tar" "${1%%/}/"; }
mktgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }