Skip to main content

Shell Alias Generator

Enter a long command and a short name — get ready-to-paste alias definitions for bash, zsh, and fish, plus instructions to make them permanent.

✓ bash / zsh / fish ✓ Function form with args ✓ Permanent install instructions

Configure Alias

Examples:

Frequently Asked Questions

What is a shell alias?▼

A shell alias is a shortcut that maps a short name to a longer command. For example, alias k='kubectl' lets you type k instead of kubectl. Aliases are evaluated by the shell before command lookup, so they can override built-in commands and save significant typing in repetitive workflows.

What is the difference between bash and zsh alias syntax?▼

Bash and zsh use identical alias syntax: alias name='command'. The difference is where you put them — bash reads ~/.bashrc (interactive non-login) and ~/.bash_profile (login shells), while zsh reads ~/.zshrc. Both support the same quoting rules. zsh also supports global aliases (alias -g) that expand anywhere in a command line, not just at the start.

How do fish shell aliases differ from bash/zsh?▼

Fish uses a different syntax: alias name 'command' (no equals sign) or the more powerful abbr --add name command. Fish abbreviations (abbr) expand inline as you type — you see the full command before running it, which is more transparent. Fish aliases go in ~/.config/fish/config.fish or individual files in ~/.config/fish/functions/.

How do I make an alias permanent?▼

Add the alias definition to your shell's config file: ~/.bashrc for bash, ~/.zshrc for zsh, or ~/.config/fish/config.fish for fish. After editing, reload with source ~/.bashrc (or source ~/.zshrc). Aliases defined in the terminal without adding to the config file only last for the current session.

When should I use a function instead of an alias?▼

Use a function when you need to handle arguments in a complex way, use conditionals, or do more than one thing. Aliases pass all arguments verbatim to the end of the command — you cannot reference $1, $2, etc. Functions let you do: function deploy { git push && ssh server 'cd app && git pull'; }. For commands that need argument manipulation, a function is always more flexible.

Can I use an alias that accepts arguments?▼

Standard aliases cannot reference positional arguments. To pass arguments at a specific position you need a function. However, for simple appending use cases — like alias grep='grep --color=auto' — arguments added by the user are automatically appended after the alias expansion, so alias ls='ls -la' then typing ls /tmp works correctly.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →