I've added the line
alias ll='ls -l'
to the /etc/bash.bashrc
. After a restart, the alias ll
from that file affects me, which I checked by commenting out the corresponding alias in my ~/.bashrc
(and logging out and back in after that edit). However, it seems to not affect root
, as when I type sudo ll
, I get "no such command". Shouldn't the alias work in any situation if it's in the system-wide .bashrc?
Best Answer
sudo
will ignore any aliased commands from.bashrc
.You can work around this by creating an alias for sudo too -->
alias sudo='sudo '
You need the space after
sudo
, sinceman
tells us: