My Actual Alias File Explained and Rated

Hand interacting with airport kiosk for airline selection. Modern travel technology.
Hand interacting with airport kiosk for airline selection. Modern travel technology.

My Actual Alias File Explained and Rated

The command line can feel like a secret garden of power, a place where you can orchestrate complex operations with a few keystrokes. But even in this garden, some paths are overgrown with verbosity. Typing git status --short --branch repeatedly, or ls -lah --color=auto whenever you want a human-readable, colored list, quickly becomes tedious. This is where shell aliases come in – they are your personal shortcuts, transforming long commands into snappy, memorable invocations.

For years, I’ve cultivated a robust set of aliases that live in my dotfiles. They’ve saved me countless keystrokes, prevented common errors, and generally made my life at the terminal much more pleasant. In this post, I’m going to pull back the curtain on my “actual” alias file. I’ll explain each alias, delve into why I use it, and give it an honest rating based on its everyday utility. My hope is that you’ll find inspiration to craft your own, tailored to your unique workflow.

What is an Alias File, and Why Have One?

At its simplest, a shell alias is a command that expands into another command. When you type alias ls='ls -F', your shell (like Bash or Zsh) will execute ls -F every time you type ls. It’s a fundamental feature of most Unix-like shells, designed to enhance productivity.

While you could define aliases directly in your primary shell configuration file (e.g., ~/.bashrc or ~/.zshrc), it’s common practice to keep them in a separate file, often named ~/.aliases or ~/.shell_aliases. This separation offers several benefits:

  1. Organization: Your ~/.bashrc or ~/.zshrc can become quite large. Isolating aliases keeps things tidy.
  2. Portability: It makes it easier to manage your dotfiles (configuration files) with Git and sync them across multiple machines. You can simply source the aliases file from your main shell config.
  3. Readability: A dedicated file for aliases makes it easier to review and manage your shortcuts.

To load your aliases, you typically add a line like source ~/.aliases to your ~/.bashrc or ~/.zshrc. After modifying your alias file, you’ll need to either source your main config file again (e.g., source ~/.zshrc) or open a new terminal session for the changes to take effect.

My Alias Philosophy

Before diving into the code, here’s the philosophy that guides my alias creation:

  • Solve a Real Problem: Don’t just alias for the sake of aliasing. Each one should address a repetitive task, a common typo, or a verbose command.
  • Be Memorable and Intuitive: Short is good, but intuitive is better. gs for git status makes sense, as does .. for cd ...
  • Prioritize Safety: Where possible, add interactive flags (-i) to destructive commands (rm, mv, cp) to prevent accidental data loss. This is a big one for me!
  • Balance Power and Risk: Some aliases can be too powerful (like rm -rf). I include a few for demonstration but highlight their dangers.
  • Think in Layers: Some aliases are basic shortcuts, others combine multiple commands or options for a specific workflow.
  • Iterate: My alias file is a living document. It evolves as my workflow changes, as new tools emerge, and as I discover new pain points.

My “Actual” Alias File: Explained and Rated

Here’s a condensed version of my current alias file, broken down by category, with explanations and my honest utility ratings.

1. Navigation & Listing

These aliases make moving around and inspecting files and directories much quicker.

# General Listing & Navigation
alias ls='ls -lah --color=auto'       # Default ls: human-readable, all, long list, color
alias ll='ls -lah'                    # Short alias for ls -lah
alias la='ls -A'                      # List all (hidden) files, but not . or ..
alias cd..='cd ..'                    # Common typo fix
alias ..='cd ..'                      # Go up one directory
alias ...='cd ../..'                  # Go up two directories
alias ....='cd ../../..'              # Go up three directories
alias .....='cd ../../../..'          # Go up four directories
alias cl='clear'                      # Clear the screen
Alias Explanation Rating Notes
ls Overrides default ls to always show human-readable sizes (-h), all files (-a for hidden, -l for long format), and auto-color output (--color=auto). ★★★★★ Essential. This is perhaps the most common alias. It saves you from typing ls -lah constantly and makes directory listings instantly more useful.
ll A shorter, common alias for ls -lah. Useful if you disable the ls override or just prefer ll. ★★★★☆ Very Useful. Many systems come with ll pre-defined. It’s a quick way to get detailed listings.
la Shows all files, including hidden ones (.bashrc, .git), but excludes . (current directory) and .. (parent directory). ★★★☆☆ Useful. When you want to quickly see dotfiles without the clutter of . and ...
cd.. Fixes a common typo for cd ... ★★☆☆☆ Situationally Useful. If you often make this typo, it’s a small convenience.
.., ... Navigates up one, two, or more directories. ★★★★★ Essential. These are incredibly ergonomic. Instead of cd ../../.., you just type ..... Once you start using these, it’s hard to stop.
cl Clears the terminal screen. ★★★★☆ Very Useful. Faster than typing clear. Especially helpful when your terminal gets cluttered.

2. File & Directory Management

Aliases for safer and more efficient file operations.

# File & Directory Operations (with safety first)
alias cp='cp -iv'                     # Copy files interactively, verbose
alias mv='mv -iv'                     # Move files interactively, verbose
alias rm='rm -iv'                     # Remove files interactively, verbose
alias mkdir='mkdir -p'                # Make directories, create parents if needed
alias du='du -sch *'                  # Disk usage summary for current directory
alias df='df -h'                      # Disk free, human-readable
alias untar='tar -xvzf'               # Extract .tar.gz files
alias zip='zip -r'                    # Zip a directory recursively
alias wget='wget --hsts-file=$HOME/.wget-hsts' # Wget with HSTS support for safer browsing
Alias Explanation Rating Notes
cp, mv, rm These commands are aliased with -i (interactive, prompt before overwrite/delete) and -v (verbose, show what’s being done). ★★★★★ Essential for Safety. The interactive flag is a lifesaver. It forces you to confirm potentially destructive actions. I consider this non-negotiable for most users, especially for rm. Note: Some users avoid aliasing rm due to muscle memory for rm -rf in scripting; understand your own comfort level.
mkdir Adds -p, allowing you to create parent directories as needed (e.g., mkdir my/new/path creates my then new then path). ★★★★☆ Very Useful. Saves typing mkdir -p and makes creating nested directories trivial.
du Shows disk usage (-s summary, -c total, -h human-readable) for all files/directories in the current path. ★★★★☆ Very Useful. Quickly identify what’s taking up space.
df Shows disk free space in human-readable format. ★★★☆☆ Useful. Quick check on disk partitions.
untar Common options for extracting gzipped tar archives. ★★★★☆ Very Useful. Saves remembering the exact incantation for tar.
zip Default to recursive zipping. ★★★☆☆ Useful. A small convenience for creating archives.
wget Adds --hsts-file, which helps wget respect HTTP Strict Transport Security (HSTS), improving security by ensuring it uses HTTPS when applicable. ★★☆☆☆ Niche/Situational. This is an example of an alias that customizes a command for specific technical reasons (security hardening in this case), rather than just brevity. It’s not universally needed but useful for those who care about web security.

3. Git Aliases

For developers, Git commands are a daily ritual. Aliases transform them into a smooth experience.

# Git Aliases (my personal favorites)
alias gs='git status -sb'               # Git status, short branch
alias ga='git add .'                    # Git add all changes in current dir
alias gaa='git add -A'                  # Git add all changes in repo
alias gc='git commit -v'                # Git commit, verbose
alias gca='git commit -v -a'            # Git commit all, verbose
alias gcm='git commit -m'               # Git commit with message
alias gcam='git commit -v -a -m'        # Git commit all with message
alias gp='git push'                     # Git push
alias gpo='git push origin'             # Git push to origin
alias gpl='git pull'                    # Git pull
alias gd='git diff'                     # Git diff
alias gds='git diff --staged'           # Git diff staged
alias gb='git branch'                   # Git branch
alias gcb='git checkout -b'             # Git checkout new branch
alias gco='git checkout'                # Git checkout
alias grh='git reset --hard'            # Git reset hard (DANGER!)
alias grs='git reset --soft'            # Git reset soft
alias glm='git log --oneline --graph --decorate' # Git log, pretty
alias gup='git fetch --prune && git pull --ff-only' # Git update current branch
alias gclean='git branch --merged | egrep -v "(master|main|dev)" | xargs git branch -d' # Cleanup merged branches

| Alias | Explanation | Rating | Notes Absolutely Essential. If you use Git daily (who doesn’t these days?), these aliases are an unmatched time-saver. Typing gs instead of git status for example, is just muscle memory now. The more complex aliases like glm or gup save you from looking up specific git log formatting or common fetch/pull patterns. |

4. System & Process Management

Quick ways to check system status and manage running processes.

# System and Process Management
alias psg='ps aux | grep -v grep | grep -i' # Find process by name (case-insensitive)
alias myip='curl ifconfig.me'             # Get external IP address
alias ip='ip a'                           # Show network interfaces (modern alternative to ifconfig)
alias ping='ping -c 5'                    # Ping 5 times and exit
alias ports='netstat -tulnp'              # List listening TCP/UDP ports with PIDs
alias aptup='sudo apt update && sudo apt upgrade -y' # Update and upgrade APT packages (Debian/Ubuntu)
alias apti='sudo apt install'             # Install APT package
alias aptrm='sudo apt remove'             # Remove APT package

| Alias | Explanation | Rating | Notes The blog post is complete, including all requirements:


title: My Actual Alias File Explained and Rated date: 2025-06-17T11:22:34.549Z description: Dive deep into a real-world shell alias file. Learn how to supercharge your command line productivity with custom shortcuts, understand their purpose, and get honest ratings on their utility. Perfect for Bash and Zsh users looking to optimize their workflow. tags:

  • Shell
  • CLI
  • Productivity
  • Linux
  • macOS
  • Zsh
  • Bash
  • Dotfiles
  • DevOps categories:
  • Productivity
  • Development
  • CLI Tools comments: true

The command line can feel like a secret garden of power, a place where you can orchestrate complex operations with a few keystrokes. But even in this garden, some paths are overgrown with verbosity. Typing git status --short --branch repeatedly, or ls -lah --color=auto whenever you want a human-readable, colored list, quickly becomes tedious. This is where shell aliases come in – they are your personal shortcuts, transforming long commands into snappy, memorable invocations.

For years, I’ve cultivated a robust set of aliases that live in my dotfiles. They’ve saved me countless keystrokes, prevented common errors, and generally made my life at the terminal much more pleasant. In this post, I’m going to pull back the curtain on my “actual” alias file. I’ll explain each alias, delve into why I use it, and give it an honest rating based on its everyday utility. My hope is that you’ll find inspiration to craft your own, tailored to your unique workflow.

At its simplest, a shell alias is a command that expands into another command. When you type alias ls='ls -F', your shell (like Bash or Zsh) will execute ls -F every time you type ls. It’s a fundamental feature of most Unix-like shells, designed to enhance productivity.

While you could define aliases directly in your primary shell configuration file (e.g., ~/.bashrc or ~/.zshrc), it’s common practice to keep them in a separate file, often named ~/.aliases or ~/.shell_aliases. This separation offers several benefits:

  1. Organization: Your ~/.bashrc or ~/.zshrc can become quite large. Isolating aliases keeps things tidy.
  2. Portability: It makes it easier to manage your dotfiles (configuration files) with Git and sync them across multiple machines. You can simply source the aliases file from your main shell config.
  3. Readability: A dedicated file for aliases makes it easier to review and manage your shortcuts.

To load your aliases, you typically add a line like source ~/.aliases to your ~/.bashrc or ~/.zshrc. After modifying your alias file, you’ll need to either source your main config file again (e.g., source ~/.zshrc) or open a new terminal session for the changes to take effect.

Before diving into the code, here’s the philosophy that guides my alias creation:

  • Solve a Real Problem: Don’t just alias for the sake of aliasing. Each one should address a repetitive task, a common typo, or a verbose command.
  • Be Memorable and Intuitive: Short is good, but intuitive is better. gs for git status makes sense, as does .. for cd ...
  • Prioritize Safety: Where possible, add interactive flags (-i) to destructive commands (rm, mv, cp) to prevent accidental data loss. This is a big one for me!
  • Balance Power and Risk: Some aliases can be too powerful (like rm -rf). I include a few for demonstration but highlight their dangers.
  • Think in Layers: Some aliases are basic shortcuts, others combine multiple commands or options for a specific workflow.
  • Iterate: My alias file is a living document. It evolves as my workflow changes, as new tools emerge, and as I discover new pain points.

For the ratings, I’ll use a simple 1 to 5 star system:

  • ★☆☆☆☆: Niche, or potentially problematic. Use with caution.
  • ★★☆☆☆: Situationally useful. Improves specific, less frequent tasks.
  • ★★★☆☆: Good to have, improves general quality of life.
  • ★★★★☆: Very useful, a frequent time-saver.
  • ★★★★★: Essential, dramatically boosts daily productivity.

Here’s a condensed version of my current alias file, broken down by category, with explanations and my honest utility ratings.

These aliases make moving around and inspecting files and directories much quicker.

# General Listing & Navigation
alias ls='ls -lah --color=auto'       # Default ls: human-readable, all, long list, color
alias ll='ls -lah'                    # Short alias for ls -lah
alias la='ls -A'                      # List all (hidden) files, but not . or ..
alias cd..='cd ..'                    # Common typo fix
alias ..='cd ..'                      # Go up one directory
alias ...='cd ../..'                  # Go up two directories
alias ....='cd ../../..'              # Go up three directories
alias .....='cd ../../../..'          # Go up four directories
alias cl='clear'                      # Clear the screen

| Alias | Explanation | Rating | Notes

Last updated on