awesome-bash-alias

🔥 Curated collection of powerful Bash aliases to boost terminal productivity.

View project on GitHub

Awesome-Bash-Alias

A curated list of awesome Bash aliases.

#About awesome-bash-alias is a curated collection of useful Bash aliases and functions designed to make your terminal workflow faster, easier, and more productive. It includes shortcuts for file management, Git, Docker, Kubernetes, networking, system monitoring, and more. Perfect for developers, sysadmins, DevOps engineers, and Linux/macOS enthusiasts.

💡 Features:

✅ Simplified navigation with directory shortcuts

✅ Docker & Kubernetes command aliases for faster container management

✅ Git shortcuts for commits, branches, pushes, and logs

✅ Quick access to system info, memory/cpu stats, and disk usage

✅ Network and ping tools for troubleshooting

✅ Safe file operations and confirmation prompts

🌟 Make your terminal smarter, faster, and more efficient!

Website: https://vikaskyadav.github.io/awesome-bash-alias/

# 🧮 Calculator

  • alias bc=”bc -l”

# 🧹 Clear

  • alias c=”clear”
  • alias cl=”clear”
  • alias ckear=”clear”
  • alias clr=”clear”

# 📂 Change Directories

  • alias .=”cd ..”
  • alias ..=”cd ../..”
  • alias …=”cd ../../..”
  • alias ….=”cd ../../../..”
  • alias …..=”cd ../../../../..”

OR

  • alias ..=”cd ..”
  • alias …=”cd ../..”
  • alias ….=”cd ../../..”
  • alias …..=”cd ../../../..”
  • alias ……=”cd ../../../../..”

  • alias .1=”cd ..”
  • alias .2=”cd ../..”
  • alias .3=”cd ../../..”
  • alias .4=”cd ../../../..”
  • alias .5=”cd ../../../../..”

  • alias ..1=”cd ..”
  • alias ..2=”cd ../..”
  • alias ..3=”cd ../../..”
  • alias ..4=”cd ../../../..”
  • alias ..5=”cd ../../../../..”

  • alias cd..=”cd ..”
  • alias cd…=”cd ../..”
  • alias cd….=”cd ../../..”
  • alias cd…..=”cd ../../../..”
  • alias cd……=”cd ../../../../..”

  • alias cd1=”cd ..”
  • alias cd2=”cd ../..”
  • alias cd3=”cd ../../..”
  • alias cd4=”cd ../../../..”
  • alias cd5=”cd ../../../../..”

# Package Management

  • alias update=”sudo apt update && sudo apt upgrade -y”
  • alias remove=”sudo apt remove”
  • alias yum-update=”sudo yum update -y”

# useful Docker functions

  • alias dl=”sudo docker ps -l -q”
  • alias dps=”sudo docker ps”
  • alias di=”sudo docker images”
  • alias dip=”sudo docker inspect –format ‘’”
  • alias dkd=”sudo docker run -d -P”
  • alias dki=”sudo docker run -i -t -P”
  • alias dex=”sudo docker exec -i -t”
  • alias dstop=”docker stop $(docker ps -q)” # stop all
  • alias drm=”docker rm $(docker ps -a -q)” # remove all containers
  • alias dclean=”docker system prune -af” # clean system
  • alias dlog=”docker logs -f” # follow logs
  • alias drmf=’sudo docker stop $(sudo docker ps -a -q) && sudo docker rm $(sudo docker ps -a -q)’
  • alias dock-run() { sudo docker run -i -t –privileged $@ ;}
  • alias dock-exec() { sudo docker exec -i -t $@ /bin/bash ;}
  • alias dock-log() { sudo docker logs –tail=all -f $@ ;}
  • alias dock-port() { sudo docker port $@ ;}
  • alias dock-vol() { sudo docker inspect –format ‘’ $@ ;}
  • alias dock-ip() { sudo docker inspect –format ‘’ $@ ;}
  • alias dock-rmc() { sudo docker rm sudo docker ps -qa --filter 'status=exited' ;}
  • alias dock-rmi() { sudo docker rmi -f sudo docker images | grep '^<none>' | awk '{print $3}' ;}
  • alias dock-stop() { sudo docker stop $(docker ps -a -q); }
  • alias dock-rm() { sudo docker rm $(docker ps -a -q); }

  • alias dock-do() { if [ “$#” -ne 1 ]; then echo “Usage: $0 start|stop|pause|unpause|" fi

    for c in $(sudo docker ps -a | awk ‘{print $1}’ | sed “1 d”) do sudo docker $1 $c done }

# Kubernetes commands

  • alias k=”kubectl”
  • alias ka=”kubectl apply -f”
  • alias kpa=”kubectl patch -f”
  • alias ked=”kubectl edit”
  • alias ksc=”kubectl scale”
  • alias kex=”kubectl exec -i -t”
  • alias kg=”kubectl get”
  • alias kga=”kubectl get all”
  • alias kgall=”kubectl get all –all-namespaces”
  • alias kinfo=”kubectl cluster-info”
  • alias kdesc=”kubectl describe”
  • alias ktp=”kubectl top”
  • alias klo=”kubectl logs -f”
  • alias kn=”kubectl get nodes”
  • alias kpv=”kubectl get pv”
  • alias kpvc=”kubectl get pvc”

# Estimate file space usage to maximum depth

  • alias du1=”du -d 1”

# Git commands

  • alias gs=”git status”
  • alias gst=”git status -sb”
  • alias gl=”git log”
  • alias ga=”git add”
  • alias gaa=”git add -A”
  • alias gal=”git add .”
  • alias gall=”git add .”
  • alias gca=”git commit -a”
  • alias gc=”git commit -m”
  • alias gcot=”git checkout”
  • alias gchekout=”git checkout”
  • alias gco=”git checkout”
  • alias gcb=”git checkout -b”
  • alias gb=”git branch”
  • alias gpo=”git push origin”
  • alias gpl=”git pull origin”
  • alias gd=”git diff”
  • alias gclean=”git reset –hard && git clean -df”
  • alias gundo=”git reset –soft HEAD~1”
  • alias gchckout=”git checkout”
  • alias gckout=”git checkout”
  • alias go=”git push -u origin”
  • alias gsh=’git stash’
  • alias gw=’git whatchanged’
  • alias gitlg=”git log –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit”
  • alias nah=”git clean -df && git checkout – .”

# History commands

  • alias h=”history”
  • alias h1=”history 10”
  • alias h2=”history 20”
  • alias h3=”history 30”
  • alias hgrep=’history grep’

# List commands

  • alias l=”ls”
  • alias l=’ls -lAh’
  • alias ls=”ls -a”
  • alias la=”ls -a”
  • alias ll=”ls -al”

# Networking Commands

  • alias pg=”ping google.com -c 5”
  • alias pt=”ping facebook.com -c 5”
  • alias ping=”ping -c 5”
  • alias fastping=”ping -c 100 -s.2”
  • alias myip=”curl ifconfig.me”
  • alias ports=”sudo lsof -i -P -n grep LISTEN”
  • alias pingg=”ping 8.8.8.8 -c 5”

# Exit Command

  • alias :q=”exit”
  • alias ext=”exit”
  • alias xt=”exit”
  • alias by=”exit”
  • alias bye=”exit”
  • alias die=”exit”
  • alias quit=”exit”

# Launch Simple HTTP Server

  • alias serve=’python -m SimpleHTTPServer’

# Confirmation

  • alias mv=’mv -i’
  • alias cp=’cp -i’
  • alias ln=’ln -i’
  • alias rm=’rm -I –preserve-root’

# Parenting changing perms on /

  • alias chown=’chown –preserve-root’
  • alias chmod=’chmod –preserve-root’
  • alias chgrp=’chgrp –preserve-root’

# Install & Update utilties

  • alias sai=”sudo apt install”
  • alias sai=”sudo apt-get install”
  • alias sau=”sudo apt update”
  • alias sau=”sudo apt-get update”
  • alias update=”sudo apt update”
  • alias update=”yum update”
  • alias updatey=”yum -y update”

# System state

  • alias reboot=”sudo /sbin/reboot”
  • alias poweroff=”sudo /sbin/poweroff”
  • alias halt=”sudo /sbin/halt”
  • alias shutdown=”sudo /sbin/shutdown”
  • alias flighton=’sudo rfkill block all’
  • alias flightoff=’sudo rfkill unblock all’
  • alias snr=’sudo service network-manager restart’

# System and File Management

  • alias dfh=”df -h” # human-readable disk usage
  • alias duh=”du -h –max-depth=1” # dir usage
  • alias md=”mkdir -p” # safe mkdir
  • alias rd=”rmdir” # remove dir
  • alias cls=”clear && ls -lh” # clear + list
  • alias reload=”source ~/.bashrc” # reload bashrc

# Show open ports

  • alias ports=’sudo netstat -tulanp’

# Free and Used

  • alias meminfo=”free -m -l -t”

# Get top process eating memory

  • alias psmem=”ps auxf sort -nr -k 4”
  • alias psmem10=”ps auxf sort -nr -k 4 head -10”

# Get top process eating cpu

  • alias pscpu=”ps auxf sort -nr -k 3”
  • alias pscpu10=”ps auxf sort -nr -k 3 head -10”

# Get details of a process

  • alias paux=’ps aux grep’

# Get server cpu info

  • alias cpuinfo=”lscpu”

# Older system use /proc/cpuinfo

  • alias cpuinfo=”less /proc/cpuinfo”

# Get GPU ram on desktop / laptop

  • alias gpumeminfo=”grep -i –color memory /var/log/Xorg.0.log”

# Resume wget by default

  • alias wget=”wget -c”

# Grabs the disk usage in the current directory

  • alias usage=’du -ch grep total’

# Gets the total disk usage on your machine

  • alias totalusage=’df -hl –total grep total’

# Shows the individual partition usages without the temporary memory values

  • alias partusage=’df -hlT –exclude-type=tmpfs –exclude-type=devtmpfs’

# Gives you what is using the most space. Both directories and files. Varies on current directory

  • alias most=’du -hsx * sort -rh head -10’

# MacOs commands

  • alias rp=’. ~/.bash_profile’
  • alias myip=’ifconfig en0 grep inet grep -v inet6 cut -d ‘ ‘ -f2’