Recently, a friend 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
Running other commands, such as sudo ls, will work fine.
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.
Ext2Fsd is a good tool for reading and writing Linux partitions. This software is introduced in the
That day, my colleague showed me an operation step on my computer, using an env command, well, I adm
First time when the basic network configuration is 1. Check the network mac address first[root@cento
for Windows 7 computers Microsoft will allow its computer OEMs and their system co-developers to d
Conflicts in Linux and their responses
PDF helper under Linux system LinuxPDFeditor
Solutions to common problems in Linux systems
Solution for ‘./mysql-bin.index’ not found (Errcode: 13)
Three lightweight WebServer--lighttpd, thttpd, shttpd introduction
The shell intercepts the specified date of the nginx log print out
The difference between chown and chmod
Nginx one-click installation script under Centos
How to determine whether Linux is running on a virtual machine
Set up a personal Bluetooth LAN under Linux
Introduction to Linux operating system network configuration process under virtual machine
How to get the real meaning of Windows 7 Aero effects theme
A few simple steps let you change the name of the recycle bin at will
How much traffic will be consumed by playing WeChat
Win8 reset ClearType utility setting trick
Windows 10 common key combination introduction
Win10 system update wireless network card driver method
Win7 system how to restore desktop shortcut icon small arrow
Win8 routine update prompt 8024200D error how to do
Automatically update the website? Windows system services help you busy