Linux_su: commandnotfounderror-Linux general technology-Linux programming and kernel information. For details, refer to the following section. In linux, I found a problem. When I use the su command to become a Super User, some commands of the management system, such as shutdown, will give me a "bash: shutdown: command not found ". according to the general idea of solving the problem:
First, this command must exist and cannot be found. It is estimated that the path is incorrect. First, I checked the shutdown command location:/sbin/shutdown, then there is the Super User's search path: (you can get it through the environment variable)
Obviously, the environment variables of super su users vary greatly. How can we get the root environment variables?
Does su have other usage? man su, read it.
Su [OPTION]... [-] [USER [ARG]...]
-,-L, -- login
Make the shell a login shell
It should be su-root/su-l/su -- login to log on as the root user.
The problem has been solved.
However, I have used the NETBSD system before. When using the su command, I can also use shutdown instead of other commands. These two system kernels are similar, should I be able to modify the environment variables for the purpose?
Vi ~ /. Bashrc
Added an export PATH = $ PATH:/sbin
After restarting, run the su command to access the Super User and check the environment variables,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.