[x]Blackmoor Vituperative

Sunday, 2009-08-16

Aliases under sudo

Filed under: Linux — bblackmoor @ 23:52

If you would like aliases to work when you use sudo (for example, so that when you type sudo ls, your directory listings are in color, assuming you set up an alias for ls="ls --color=auto"), add the following lines to your ~/.bashrc:

# Enable aliases when using sudo.
alias sudo='sudo ' # Note the trailing space.

Credit for this goes to Curtis Free. Thanks, Curtis.