O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

alias

Synopsis

alias [option] [name[='cmd']...]

Assign a shorthand name as a synonym for cmd. If ='cmd' is omitted, print the alias for name; if name is also omitted, print all aliases. By itself or with -p, alias prints one alias per line on standard output as alias name=value. If the value contains a trailing space, the next word on the command line also becomes a candidate for alias expansion. See also unalias.

Option

-p

Print the word alias before each alias.

Example

alias dir='echo ${PWD##*/}'

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required