Working with Bash Aliases (Alias/Unalias)

Bash - GNU Shell, Tips Add comments

Aliases allow a string to be substituted for a word when it is used as the first word of a simple command. The shell maintains a list of aliases that may be set and unset with the alias and unalias builtin commands.

You can set your aliases into your .bashrc file. Following some common aliases:

alias ls=’ls –color=auto’
alias dir=’ls –color=auto –format=vertical’
alias vdir=’ls –color=auto –format=long’
alias ll=’ls -l’
alias la=’ls -A’
alias l=’ls -CF’

All this is nice but how can you unset all this stuff ? Simple ! Use unalias builtin command.

# unset “ll” alias
unalias ll

# unset all aliases
unalias -a

Aliases are not expanded when shell isn’t interactive, unless the expand_aliases shell option is set using shopt.

shopt -s expand_aliases

Share this post with your network :These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in