Ad space (banner)
🖥️Linux Lessons
Lesson 34 / 61

Giving a Command a Nickname with alias

alias is for when "typing this long command every single time is a pain." alias attaches a short nickname to an existing command, so you can invoke it under that nickname instead.

Use it in the form alias nickname='original-command'. Afterward, simply typing the nickname produces the same result as running the original command.

Running alias ll='ls -la' means from then on, just typing ll gives you the same detailed file listing as running ls -la.

A common early mistake is that, just like export, an alias also disappears when you close the terminal. To keep it permanently, you need to write it into a file like .bashrc.

In real work, this is set up a lot for boosting efficiency — shortening a long, frequently-used command, like turning git status into gs.

Linux
Try it (type this into the pseudo terminal)
alias ll='ls -la'

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)