1001Ferramentas
📂 Dev

Bash/Zsh Aliases Generator

Predefined list of useful aliases (ll, la, gs, gd, gco, mkcd, ip) ready to paste into .bashrc or .zshrc.

The shell aliases worth having

An alias is text substitution at the start of a command line. The gain is not saving keystrokes — it is making cheap a command you would otherwise avoid for being long, and pinning the right options on commands you always run the same way. Nobody types ls with three flags all day; everybody types ll.

Tick the groups you care about and the page assembles the block. Covered are listing, Git, navigation — including the ones that climb directories, which save a surprising amount — and networking. One detail: the shortcut that creates a directory and enters it is not an alias but a function, because an alias takes no argument in the middle; it only pastes text at the front of the line.

Where to put it depends on the shell and how it starts. In bash, ~/.bashrc is read by an interactive non-login shell, which is the terminal you open in a desktop session; ~/.bash_profile is read at login. Many distributions have the profile source the bashrc precisely to avoid that confusion. In zsh the equivalent is ~/.zshrc. After editing, either open a new terminal or reload with source.

Frequently asked questions

When should I use a function instead of an alias?
Whenever you need an argument anywhere but at the end. An alias only prefixes: typing ll /tmp lands /tmp after everything the alias expanded to. A function receives the arguments and you decide where they go — which is why the create-and-enter-directory shortcut has to be a function.
How do I run the original command an alias replaced?
Prefix it with a backslash: backslash-ls calls the real ls, bypassing the alias. command ls and the full path work too. Handy when the alias adds options that get in the way in a specific case, such as colours inside a pipe.
Do aliases work inside a script?
By default no: alias expansion is off in non-interactive shells. That is deliberate, because a script depending on the runner's aliases is fragile. In a script, use a function or write the command out in full.

Related Tools