M
M
mr_blond972015-09-23 03:02:23
Debian
mr_blond97, 2015-09-23 03:02:23

Sudo: command not found on some commands. How to make it work?

Tell me why commands with sudo may not work if sudo -s works?
$ sudo: ll: command not found

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Ruslan Fedoseev, 2015-09-23
@martin74ua

sudo su -
The sudo su
commands look the same, but work in a slightly different way.
Very often the sudo su command is typed, and then we wonder why the commands from sbin are still not available
. The fact is that by default the /sbin /usr/sbin directories are added to the root path, while ordinary users do not have them.
sudo su - change as root with setting the root environment
sudo su change as root and save the environment of the current user
In the first case, the path will change, and /sbin /usr/sbin will fall into it, and in the second - not.
In your case, like - sudo -s sets the environment from the root settings, and without -s, yours is saved.
Treat by reading the documentation, understanding the difference and applying the correct commands and switches in different situations

S
Saboteur, 2015-09-23
@saboteur_kiev

because there is no such command ll
ll et alias, and after sudo you have the privileges of another user, don't you?

P
Puma Thailand, 2015-09-23
@opium

ll alias command, and it doesn't exist if you didn't add it

V
Vlad Zhivotnev, 2015-09-23
@inkvizitor68sl

sudo reads root's .bashrc, it's empty out of the box.
Some kind of sudo ls will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question