Skip to content
10 Actually Useful Terminal Aliases (2026)

10 Actually Useful Terminal Aliases (2026)

DodaTech Updated Jun 20, 2026 4 min read

Aliases look trivial — shortcutting cd .. to .. or git status to gst saves one second per invocation. But over hundreds of invocations per day, those seconds compound into minutes. More importantly, aliases reduce friction: when a command is easy to type, you’re more likely to use it. These ten cover navigation, Git, networking, and file operations.

The Aliases

.., ..., .... — Parent directory shortcuts

alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."

No more cd ../../../ guesswork. Each dot equals one level up. Extend to five or six levels if you work in deep nested projects.

g — Git shortcut with auto-subcommands

alias g="git"

Three letters → one letter. g status, g add, g commit, g push, g log. When you type Git commands 50+ times a day, this saves hundreds of keystrokes.

gcmsg — Git commit with message

alias gcmsg="git commit -m"

gcmsg "Fix auth bug" instead of git commit -m "Fix auth bug". Small saving, high frequency.

npmls — List top-level npm dependencies

alias npmls="npm ls --depth=0 2>/dev/null"

Shows your direct dependencies without the sprawling tree. The 2>/dev/null suppresses missing peer dependency warnings.

ports — Find what’s listening on ports

alias ports="lsof -i -P -n | grep LISTEN"

Lists every process with an open port. Faster than netstat and more readable. Pipe to grep 3000 to check if a specific port is in use.

myip — Your public IP address

alias myip="curl -s https://api.ipify.org && echo"

Returns your public IP with a trailing newline. Add -4 for IPv4, -6 for IPv6. Useful for VPN checks, debugging network config, or sharing your IP quickly.

weather — Forecast in the terminal

alias weather="curl -s 'wttr.in/~city?u'"

Replace city with your location. ?u for metric units. Shows a 3-day forecast with temperature, humidity, wind, and moon phase.

md — mkdir and cd in one command

alias md="mkdir -p $1 && cd $1"
# Better as a function:
md() { mkdir -p "$1" && cd "$1"; }

Creates a directory and navigates into it. The function version works because aliases can’t handle positional arguments cleanly.

catbat — Syntax-highlighted file viewing

alias cat="bat --style=plain"

Replaces cat with bat, adding syntax highlighting, line numbers, and git change markers. The --style=plain keeps output clean for piping. Install bat first: brew install bat or apt install bat.

lseza / lsd — Modern file listing

alias ls="eza --icons --group-directories-first"
alias ll="eza -l --icons --group-directories-first"
alias la="eza -la --icons --group-directories-first"
alias tree="eza --tree --icons"

eza (or lsd) is ls with color, icons, human-readable sizes, and directory grouping. Install with brew install eza or apt install eza. The alias preserves ls behavior but makes it dramatically more readable.

# If using lsd instead:
alias ls="lsd"
alias ll="lsd -l"
alias tree="lsd --tree"

Bonus: Add these to .zshrc or .bashrc

# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias md="() { mkdir -p \"\$1\" && cd \"\$1\"; }"

# Git
alias g="git"
alias gcmsg="git commit -m"
alias gp="git push"
alias gl="git log --oneline --graph --decorate --all"

# Files
alias ls="eza --icons --group-directories-first"
alias ll="eza -l --icons"
alias cat="bat --style=plain"

# Network & system
alias ports="lsof -i -P -n | grep LISTEN"
alias myip="curl -s https://api.ipify.org && echo"
alias weather="curl -s 'wttr.in/~london?u'"

# npm
alias npmls="npm ls --depth=0 2>/dev/null"
Where do I put these aliases?
Put them in ~/.zshrc (zsh) or ~/.bashrc (bash). After editing, run source ~/.zshrc or open a new terminal. On macOS, zsh is the default shell since Catalina.
Do I need to install bat and eza separately?
Yes. bat and eza are standalone tools, not built-ins. Install via your package manager: brew install bat eza (macOS), apt install bat eza (Debian/Ubuntu), or download the binaries from GitHub releases.
Will aliases conflict with existing commands?
Overriding cat or ls with aliases shadows the originals. To call the original, type \cat or command cat. The aliases here preserve all original flags and behavior — they only add features. If you need the raw versions, \ls and \cat always work.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro