4

I would like to be able to run the aliased commands I have defined for my current user in conjunction with sudo as well.

This does not work by default, because they would have to be defined for root instead of my current user in order to work with sudo.

An example is the ll alias:

$ type ll
ll is aliased to `ls -alF'
$ sudo ll /
sudo: ll: command not found

A special problem would be nested aliases:

bytecommander@BC-AlkaliMetal:~$ type ls
ls is aliased to `ls --color=auto'

So actually ll should evaluate to ls -alf --color=auto.

How can I run aliases defined for my current user as root with sudo properly?

Byte Commander
  • 107,489

0 Answers0