Linux Basic Command-CHGRP/CHOWN/CHOMD

Source: Internet
Author: User

CHGRP changing the owning user group

The group name to be changed must exist within the/etc/group file;

CHGRP [-R] Dirname/filename

-r: Continuous changes to the recursive, with all files and directories under the subdirectory updated to the new user group

Chown Changing the file owner

If you want all subdirectories or files under the directory to change the file owner at the same time, add the-r parameter directly

Chown [-r] Account name file or directory

Chown [-r] Account name : Group name file or directory

Chown [-r] Account name . Group name file or directory

chmod changing permissions

Number Types Change file permissions
[email protected] tmp]# lltotal4drwxr-xr-x.2Root root4096The A  .: OneFoo[[email protected] tmp]#chmod  thefoo/[email protected] tmp]#lsFoo[[email protected] tmp]# lltotal4D---------. 2Root root4096The A  .: OneFoo[[email protected] tmp]#chmod 777foo/[email protected] tmp]# lltotal4drwxrwxrwx.2Root root4096The A  .: OneFoo[[email protected] tmp]#chmod 641foo/[email protected] tmp]#lsFoo[[email protected] tmp]# lltotal4DRW-R----X.2Root root4096The A  .: OneFoo[[email protected] tmp]#chmod 755foo/[email protected] tmp]# lltotal4drwxr-xr-x.2Root root4096The A  .: OneFoo[[email protected] tmp]#
Symbol Type Change file permissions
[Email protected] tmp]#chmodu=rwx,g=rw,o=rw/tmp/foo/[email protected] tmp]# lltotal4DRWXRW-rw-.2Root root4096The A  .: OneFoo[[email protected] tmp]#chmodu=rx,g+x,o-rw/tmp/foo/[email protected] tmp]# lltotal4Dr-XRWX---.2Root root4096The A  .: OneFoo[[email protected] tmp]#chmodugo=rw/tmp/foo/[email protected] tmp]# L-bash:l: Command not found[[email protected] tmp]# lltotal4DRW-rw-rw-.2Root root4096The A  .: OneFoo[[email protected] tmp]#chmodug=rw,o-rw/tmp/foo/[email protected] tmp]# lltotal4DRW-RW----.2Root root4096The A  .: OneFoo[[email protected] tmp]#

Linux Basic Command-CHGRP/CHOWN/CHOMD

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.