Skip to content

BASH Shell Aliases

Last updated 2026-08-20 · 4 notes · 4 tags

Tags: bash aliases terminal config

Aliases are short shortcuts for longer commands. They live in your shell config file (~/.bashrc for Bash).

Edit and reload

nano ~/.bashrc

After saving:

source ~/.bashrc

Note: If a new alias does not work, you forgot to source or you edited a different file than the shell is using.

Example aliases

Replace placeholders before you save the file.

Note: The rm alias below needs trash-cli — set it up first in Safe delete.

# Safer delete (requires trash-cli — see Safe delete above)
alias rm='trash-put'

# Short listing
alias ll='ls -al'

# Jump to projects
alias proj='cd ~/projects'

# Common Git status
alias gs='git status'

# Optional: your timezone
# export TZ='Your/Timezone'

Example helper that shows fetch + status:

gsync() {
    echo "=== Fetching from GitHub ==="
    git fetch --all --tags
    echo
    echo "=== Local branches ==="
    git branch -vv
    echo
    echo "=== Repository status ==="
    git status
}

Note: Function blocks like gsync() also go in ~/.bashrc, then reload with source ~/.bashrc.

Environment variables (API keys)

Store secrets in your private shell config or a local .env file that is not committed to Git.

# EXAMPLES ONLY — never commit real keys
# export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
# export GEMINI_API_KEY="your-key-here"

Note: Real keys in a public GitHub repo can be stolen by bots within minutes. Revoke any key that was pushed by mistake.

PATH extras (placeholders)

Tools like pipx often add a line similar to:

export PATH="$PATH:/home/YOUR_USERNAME/.local/bin"

On WSL, a Windows GUI app path might look like:

# Example only — adjust to your Windows username and install path
# alias ollama="/mnt/c/Users/YOUR_WINDOWS_USERNAME/AppData/Local/Programs/Ollama/ollama.exe"

Note: Copy paths from your own machine (which / File Explorer address bar). Do not reuse someone else’s username paths.

Common mistakes

  • Comment lines with # so you remember why an alias exists.
  • After you change ~/.bashrc, open a new terminal (or run source ~/.bashrc) to confirm everything still loads.

This content repository is based on the hands-on experience of Naveen Bachwani. AI tools were also used in augmenting and refining it. The goal is to help non-technical users get familiar with these tools, so they may be able to use them effectively.

Readers are responsible for using any commands or instructions provided here with appropriate caution. The creator of this site accepts no responsibility for system damage, data loss, or other consequences resulting from their use.