pavement

Alias (command)

From FreeBSDwiki
Revision as of 03:25, 9 August 2012 by DavidYoung (Talk | contribs)
Jump to: navigation, search

The alias command is used to create aliases, and to get a list of aliased commands.

Contents

Aliases creation

The syntax is shell dependent:

B-Shell (sh, bash) and Z-Shell (zsh) :

alias l=ls
alias la='ls -A'

C-Shell (csh, tcsh) :

alias l ls
alias la 'ls -A'

Special functions

Some shells provide additional features, such as the -g argument of zsh's alias built-in command. This allow creation of global aliases :

> alias a=aaa
> alias -g b=bbb
> echo a b
a bbb

This can be very useful :

> alias -g ...='../..'
> pwd
/foo/bar/misc
> cd ...
> pwd
/foo

For more information on the specific options of your shell, check its man page.

Aliases consultation

You can use this to get a list of existing aliases:

> alias
...=../..
....=../../..
.....=../../../..
......=../../../../..
.......=../../../../../..
clean='rm -f `find . -name "*~" -o -name ".*~" -o -name ".*.core" -o -name "*.core" -o -name "#*#" -o -name "a.out"`
close='cdcontrol -f /dev/cd0 close'
eject='cdcontrol -f /dev/cd0 eject'
fr='export LANG=fr_FR.ISO8859-15'
la='ls -a'
ll='ls -Al'
ls='ls -FG'
> alias ls
ls='ls -FG'

See also: unalias, which

Servant Leadership: Helping People Come Alive

"Its a powerful perspective on work -- holding within it a value for collaboration, agency, creativity, and meaning. What if we all could see what we do in that way? What if our organizations supported us in holding that perspective, and to go one step further, how can we create institutions that release these core values? In his seminal 1970 essay 
[Servant Leadership: Helping People Come Alive]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Not Your Usual Panhandler

Doug Eaton wanted to celebrate his birthday on June 11 in a big way, so he turned to his friends for ideas -- ended up marking the day with random acts of kindness, including handing out free money to people passing by.

[Not Your Usual Panhandler]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Meeting Michael

I was sitting at my desk today, looking out the window. I saw an old homeless man crossing the street, carrying a suitcase. I remembered the many times I had looked on from afar, feeling sorry for the homeless but doing nothing. I do give money to homeless people when I walk by, but never really interact with them, beside a smile.

[Meeting Michael]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

10 Ways to Love Where You Live

Community is not just for extroverts.For thousands of years, our ancestors lived in barrios, hamlets, neighborhoods, and villages. Yet in the time since our parents and grandparents were young, privacy has become so valued that many neighborhoods are not much more than houses in proximity.

[10 Ways to Love Where You Live]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Man Climbs Worlds 14 Tallest Peaks

Hirotaka Takeuchi has gotten official certification for his feat of climbing the worlds 14 tallest mountains. Hes the 30th person ever and the first Japanese person to accomplish the feat.

[Man Climbs Worlds 14 Tallest Peaks]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Personal tools