Overview of permissions management for Linux directories and files

Source: Internet
Author: User
Tags chmod

The permissions meaning of the file

R: Indicates that the contents of the file can be read

W: Indicates that you can edit, add, or modify the contents of the file, but do not have permission to delete the file

X: Indicates that the file can be executed

Permissions meaning of the directory

R: Indicates a permission to read the list of directory structures, that is, you can use the LS command to list the files in the directory

W: Change the permissions for the list of directory structures, including: New, delete, rename, move all files and directories under the directory

X: To support access to the directory becomes working directory (CD command)

Commands for modifying permissions and properties

CHGRP: Modifying the owning user group

Chown: Modify the owning user and user group

chmod: Modifying Permissions

CHGRP [-R] Dir/filename  
Chown [r] user:group dir/filename chmod  
[-R] XYZ Dir/filename

-R represents a recursive modification for a directory, which is modified along with all the files and home directories in the directory.

Default Permissions Umask

Umask refers to the current user's default permissions when creating new files and directories, noting that directories and files are not the same.

For example, suppose the umask is 0022, the default permission for the file is 666-022, and the default permission for the folder is 777-022.

The relationship between commands and permissions

Allow users to enter a directory to become the basic permissions of the working directory

Commands: CD, ls

Permissions: Directory RX permissions

Permissions to read files

Command: Cat, less, etc.

Permissions: directory x, File R

Permissions to modify Files

Command: VI

Permissions: directory x, File RW

Permissions to create files

Permissions: Directory WX

Execute command permissions

Permissions: directory x, file X

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.