Skip to content

Instantly share code, notes, and snippets.

@ltdev22
Last active February 14, 2023 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ltdev22/4c7a8d0d68cc7aa0085868d4732e6374 to your computer and use it in GitHub Desktop.
Save ltdev22/4c7a8d0d68cc7aa0085868d4732e6374 to your computer and use it in GitHub Desktop.
Useful aliases for commands I run in the terminal
# Terminal commands
alias ll="ls -lAFh"
alias c="clear"
alias bbd="brew bundle dump --force --describe"
alias trail='<<<${(F)path}' # output in a human friendly format the $PATH - works with single quotes this command
# Git
alias ga="git add"
alias gaa="git add ."
alias gcm="git commit -m"
alias gca="git commit --amend --no-edit"
alias gc="git checkout"
alias gcb="git checkout -b"
alias gcd="git checkout -d"
alias gdiff="git diff"
alias glog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
--abbrev-commit"
alias push="git push"
alias pull="git pull"
alias gs="git status"
alias gst="git stash"
alias nah="git reset --hard;git clean -df;"
# Docker
alias di="docker image"
alias dn="docker network"
alias dv="docker volume"
alias dpr="docker system prune --volumes"
alias dsa="docker stop $(docker ps -a -q)"
alias dc="docker-compose"
alias dcb="docker-compose build"
alias dcps="docker-compose ps"
alias dcup="docker-compose up"
alias dcupb="docker-compose up --build"
alias dcupd="docker-compose up -d"
alias dcstop="docker-compose stop"
alias dcdown="docker-compose down -v"
alias dcrun="docker-compose run --rm"
alias dcexec="docker-compose exec"
alias dlogs="docker-compose logs -f"
@ltdev22
Copy link
Author

ltdev22 commented Feb 17, 2021

In the terminal:

  • touch ~/.aliases
  • nano ~/.zshrc
  • Add this . ~/.aliases into zshrc to import the aliases and save
  • source ~/.zshrc or close and open again the terminal to apply the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment