Home / Configs / Developer tools / .bashrc and .zshrc aliases

Bash and zsh aliases: useful shortcuts for .bashrc and .zshrc

Add handy shortcuts and settings to your terminal.

For bash and zsh on Linux and macOS (Git Bash on Windows also works). macOS uses zsh by default, so add the lines to ~/.zshrc there.

Aliases are short names for long commands. Pick the shortcuts you want below, download the file, and add it to the end of your .bashrc or .zshrc.

Create your config file

Type your own values. The file below updates as you type, and nothing you type leaves your browser.

~/.bashrc (add to the end)
# Added by localconfig.com
alias ll='ls -alFh'
alias ..='cd ..'
alias ...='cd ../..'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias gs='git status -sb'
alias gl='git log --oneline --graph --decorate'
alias gp='git pull'
alias update='sudo apt update && sudo apt upgrade -y'
mkcd() { mkdir -p "$1" && cd "$1"; }
export EDITOR=nano
export HISTSIZE=10000
export HISTFILESIZE=10000
export SAVEHIST=10000

How this setup works

Diagram: aliases.sh, then ~/.bashrc, then Terminal
aliases.sh (your shortcuts) → ~/.bashrc (loads at every terminal) → Terminal (short commands)

Step-by-step setup

  1. Download the file and open a terminal in the same folder.
  2. Add it to the end of your shell file: cat aliases.sh >> ~/.bashrc (zsh users: ~/.zshrc).
  3. Load it now: source ~/.bashrc.
  4. Try it: type update or gs.

What the important lines mean

Common errors and how to fix them

command not found after saving
Open a new terminal or run source ~/.bashrc. The file only loads when a terminal starts.
Aliases work in bash but not zsh
Zsh reads ~/.zshrc. Add the same lines there.
Alias breaks with a quote error
Do not use single quotes inside an alias command. The alias command field blocks them.

Frequently asked questions

Where do I put aliases, .bashrc or .zshrc?
Use ~/.bashrc if your shell is bash and ~/.zshrc if it is zsh. macOS uses zsh by default.
Why do my aliases not work after I save?
The file loads only when a terminal starts. Open a new terminal or run source ~/.bashrc.
What is the difference between an alias and a function?
An alias replaces a word with text. A function can take arguments, so use a function when you need to pass something like a folder name.

Written for: bash 5.2, zsh 5.9, Ubuntu 24.04, macOS 14 · Updated 2026-10-02

Free tools that help

More developer configs

See all 41 config generators