Paul Ferguson Maxson 50a9ecf64e Adds a page on the alias command to the bash section of the guide (#24393)
* added dir and index.md

* Wrote explanation in index.md
2019-03-11 07:09:11 -07:00

1.1 KiB

title
title
Bash Alias

Alias

Set shortcuts for command line input to save time typing and recall complex commands easily.

Usage example

alias l="ls -alt". You can now simply input l and the shell will understand it as ls -alt.

Common implementation

It is common to place calls to alias in an rc file, such as .bashrc for the bash shell. Bash runs the contents of the .bashrc file every time a new shell is opened, so aliases created there will always be available. (If you simply call alias in the command line, it will only exist for that terminal window.) These files live in the home directory (~/). The . at the beginning of the filename makes the file hidden, requiring the -a flag for ls to show it. .bashrc is not created by default, so you may have to touch it yourself.

Further reading