Aliases under sudo
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.
Comments Off on Aliases under sudo