A friend recently asked me why the sudo cd and sudo ll login commands have the following prompts:
sudo: ll: command not found sudo: cd: command not found
Run other commands, such as sudo ls, etc. to run normally.
In a nutshell, it can be understood that sudo can only execute commands that come with the system, but not other programs. Such as ll, cd, etc. are brought by the shell.
sudo is a program used to enhance the user's permissions. Entering sodu in linux is to call this program to enhance permissions. The shell is a command parser, sudo cd is wrong, because cd is built into the shell. , not in the system, sudo can run the system with the command, but can not use the commands in a software in the system.
cd is the internal command of the shell. The so-called shell is an interactive application. When the shell executes an external command, it forks a child process through fork/exec and then executes the program. Sudo means to fork a process with someone else's privileges and run the program. And cd is an internal command, that is, it is run directly by the shell, not a fork process. Of course, you can't upgrade the permissions of the process in the current process (in fact, it can be, but it is written in the code when programming, and then compiled, and our shell does not have this function, otherwise it is not too dangerous?)
< In addition, if you want to configure the sudo command, you can use visudo to configure it under the root user.
Computer Store News: first Linux systems for flat panel launch For those who have tired of the N
Generally speaking, after installing ubuntu, the centralized display driver has been installed. Howe
1. /The root partition is a mandatory partition, partitioned according to your actual situation. 2.
Speaking of the command, you have to mention this special command vi it is not only a command, but a
Nfs optimization configuration test tutorial
The colrm command usage in Linux
4 useful tips for the Linux mkdir, tar, and kill commands
ADSL telephone line interference causes the network to drop frequently
JFS System in Linux Server Operating System Log Files
How to choose a Linux desktop environment
Explain the ADSL dial-up method under Linux system
One hard disk installed two Linux methods
Win7 system IE browser does not have "use software rendering instead of GPU rendering" option
Meitu Xiuxiu quickly brightens KTV party photos
What if Linux forgets the password?
How to switch Korean into Simplified Chinese under Win10?
Meet the 4G era, Win8.1 Update regression traffic management
Log Secret Windows login type knows how
Xp automatically restart after shutdown. What should I do?
Jump Lists for Windows 7 Taskbar Development
Modify the registry to Windows 7 screen saver pattern
HIPS tool Win7 system completely shut down detailed methodology