How To Wiki

How to add remove or view an alias in unix

1,795pages on
this wiki
Add New Page
Talk0 Share

Aliases of commands are used to make life easier by shortening commands the user uses often, and becomes tedious to type the entire command


to create an alias

  • for csh,tcsh: alias ls ls -a
  • for ksh: alias -x ls="ls -a"
  • for ksh: alias ls="ls -a"

to view an alias

  • execute: alias Alias_Name

to remove an alias

  • execute: unalias Alias_Name

to make an alias permanent put in your shells startup script i.e. ~/.bashrc ~/.bash_profile ~/.profile

See: Howto configure bash startup scripts


  • alias mntcd='mount /mnt/cdrom'
  • alias unntcd='umount /mnt/cdrom;eject /mnt/cdrom'
  • alias shut='/sbin/shutdown -hP 1'
  • alias fmplayer='mplayer -fs'
From HowTo Wiki, a Wikia wiki.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.