Linux Basics (7) Modify the owner of the file, belong to the group, permissions

Source: Internet
Author: User

Modify the owner of the file under Linux, the group and the permissions of the command has chown chmod chgrp umask

1.chown Modify the owner of the file

chown [options] username file_name ...

-R Recursive modification if file is a directory

Chown can also be used to modify the owner of the user, belong to the group

Chown username.grpname file_name

or Chown username:grpname file_name

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/84/21/wKiom1eGHqjjgcaQAAD2hyMdABo182.jpg-wh_500x0-wm_3 -wmp_4-s_2727372101.jpg "title=" chown.jpg "alt=" Wkiom1eghqjjgcaqaad2hymdabo182.jpg-wh_50 "/>

2.chmod permissions to modify files

Chomod MODE File ... Mode can be a decimal value corresponding to three sets of permissions.

-R Recursive modification

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/84/20/wKioL1eGH0nSxCoaAAC9jMH72Lo577.jpg-wh_500x0-wm_3 -wmp_4-s_522602652.jpg "title=" 2.jpg "alt=" Wkiol1egh0nsxcoaaac9jmh72lo577.jpg-wh_50 "/>

You can also modify permissions for a class of users (Owner,group,others)

Modify a class of users or a class (belong to the main U Group G other people o everyone a) User rights:

U,g,o,a

chmod user category =mode file,...

Modify some or some bit permissions for a class of users:

U,g,o,a

chmod user category +|-mode file,.. (+ represents the addition of a permission, which means that a permission is removed).

Remove the executable permission of 1.txt

chmod a-x 1.txt

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/84/20/wKioL1eGIISQiJ7lAAC6hb6SiyM795.jpg-wh_500x0-wm_3 -wmp_4-s_1801428800.jpg "title=" 3.jpg "alt=" Wkiol1egiisqij7laac6hb6siym795.jpg-wh_50 "/>

3.chgrp change Genus Group #so easy Skip

4.umask Mask code used to set the file to define permissions that cannot be created at the time of file creation

In the creation of the file, with 666-matte code to get the file's permissions #注意, the file default is not x permission, if the result has X permission, you should add its permissions 1

When creating a table of contents, the result of subtracting the 777-mask code is the permissions of the directory

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/84/20/wKioL1eGIijxcUAzAAEaa6r3_u0275.jpg-wh_500x0-wm_3 -wmp_4-s_556007012.jpg "title=" 4.jpg "alt=" Wkiol1egiijxcuazaaeaa6r3_u0275.jpg-wh_50 "/>

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/84/21/wKiom1eGIniSicuxAAB5HmpCO9I196.jpg-wh_500x0-wm_3 -wmp_4-s_1627189245.jpg "title=" 5.jpg "alt=" Wkiom1eginisicuxaab5hmpco9i196.jpg-wh_50 "/>

This article is from the "thick Product Thin Hair" blog, please make sure to keep this source http://joedlut.blog.51cto.com/6570198/1826161

Linux Basics (7) Modify the owner of the file, belong to the group, permissions

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.