.. include:: ../header.txt .. _alias: :command:`alias` =========================== .. index:: alias, unalias :title:`Linux for Programmers and Users`, Sections 6.4.1 .. program:: alias .. describe:: alias An alias is a short cut command to a longer command. Users may type the alias name to run the longer command with less typing. Without arguments, :command:`alias` prints a list of defined aliases. A new alias is defined by assigning a string with the command to a name. Alias are often set in the ``~/.bashrc`` file. SYNOPSIS :command:`alias` [-p] [name[=string]] OPTIONS: .. option:: -p Display all aliases in a format suitable for input to the shell. Examples:: alias c='clear' alias lf='/bin/ls --color -CF' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias r='fc -s' alias vi='vim' .. note:: If a user wishes to run a command without the alias definition, they can type a `\\` character in front of the command. For example, with the above alias definitions, the :command:`ls` command displays as if :command:`ls --color=auto` were typed. To see `ls` without the `color` option, type :command:`\\ls`. .. program:: unalias .. describe:: unalias Remove defined aliases SYNOPSIS :command:`unalias` [-a] name [name ...] OPTIONS: .. option:: -a Remove all aliases Auto Completion ================ .. index:: auto completion, TAB key Another typing short-cut is BASH's auto completion feature. BASH can complete a filename, command name, username or shell variable that you have begun to type if enough has been typed to uniquely identify it. While typing on the command line, press *TAB* to see if BASH can complete the word you are typing. If it can not identify a completion, nothing appears on the command line, but by pressing *TAB* a second time, a list of possible matches is displayed.