Nine, linux system: file or folder permissions related instructions

Applicable authority operating instructions:

1, some file systems only allow the root user access, ordinary users can not access, it may be time to consider improving user rights to the root:
instructions are as follows:

#以root身份运行:
sudo -s
#退出root:
ctrl + D

2, when accessing a folder or edit the file, folder or some files may only read permissions, without written permission, we will not be edited;
3, when the on-line program, configured as static files nginx server, you need to open access to the folder;

Case 2 and 3, we can read and write permissions to the folder or file to authorize
the relevant instructions are as follows:

#查看某个文件的权限:
ls -l filename

#对一个文件夹授予最高权限:
#授予fdfs_client文件夹及其下的文件最高权限
sudo chmod -R 777 fdfs_client
#备注:-R 是指级联应用到目录里的所有子目录和文件,777是所有用户都拥有最高权限(权限码不止是777,还可以自定义其他的权限)

Note:
When a folder or file to grant certain rights, if we do not switch to the file directory, then we need to specify an absolute path
such as:
test.py files are in / home / python / below, so if you want to open test the highest authority .py file, authorized exact wording is:

sudo chmod /home/python/test.py

If the test folder in / home / python / below, to grant test folder below the highest authority of all the files and subfolders, use

sudo chomd -R 777 /home/python/test/
Published 47 original articles · won praise 74 · views 7908

Guess you like

Origin blog.csdn.net/Jacky_kplin/article/details/104744941