Linux study Note 2 permission management commands

Source: Internet
Author: User
Linux study Note 2 permission management command link: Linux study Note 1 file operation command example...
Linux study Note 2 permission management command link: Linux study Note 1 file Operation Command http://www.2cto.com/os/201211/169196.html 1. use the chmod command to change the permissions of a file or directory: www.2cto.com u -- owner g -- owner group o -- other people chmod u + wx chmod g-r chmod o = rwx permissions before execution 644:-rw-r --. 1 root 0 November 18 17:20 dd.txt run [root @ CentOS-Test bak] # chmod u = rwx dd.txt run after limit 744:-rwxr -- r --. 1 root 0 November 18 17:20 dd.txt second method: rwx -- readable writable executable number to represent: R-4 W-2 X-1 [root @ CentOS-Test bak] # chmod 777 dd.txt-rwxrwxrwx. 1 root 0 November 18 17:20 dd.txt [root @ CentOS-Test bak] # chmod 641 dd.txt-rw-r ---- x. 1 root 0 November 18 17:20 dd.txt note: Understanding of rwx file permissions r: indicates you can view the file content, and you can list the file name for the directory w: indicates that you can write content to a file, and create or delete directories. x indicates that you can execute commands and script 2 and chown commands on the file, change the owner of a file or directory [root @ CentOS-Test data] # chown test bak drwxr-x -- x. 2 test root 1024 November 18 17:37 bak3, umask modify the default permissions of files or folders to view the default permissions of the system, that is, the default permissions for creating files: [root @ CentOS-Test data] # umask-S u = rwx, g = rx, o = rx [root @ CentOS-Test data] # umask 0022 (permission mask value) 0: special permission class 022: user permission bit, which is a mask value. The final permission is 777-022 = 755 linux permission rule: the file created by default does not have the executable permission [root @ CentOS-Test data] # touch cc.txt [root @ CentOS-Test data] # ll cc.txt-rw-r --. 1 root 11 October 11 17:59 cc.txt change the default permission for file creation: use 777-default permission to generate = mask value, it is best not to change the default permission [root @ CentOS-Test data] # umask mask value
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.