关于sudo与cd的

http://askubuntu.com/questions/57789/how-to-enter-to-the-directory-with-cd-command-if-it-has-700-permission


sudo cd won't work because the cd command is built into the shell. So you are saying become root and then run this command. You become root and then the command after sudo is searched for but there is no cd command to find.

The method to use is to switch to the user that owns the directory. Permission 700 is meant as "owner can read, write and execute".

So if root owns the directory sudo su, password and then cd {dir} is the only correct method. If someone else owns the directory you can still use the 1st method but can also change to that user with su {username} and then use cd as that user.



猜你喜欢

转载自blog.csdn.net/tryItnow/article/details/8746122
cd
今日推荐