The difference between Linux chown and chmod commands

Source: Internet
Author: User
Tags readable

Chown Modify the files and folders of the user and user Group property 1, to modify the owner of the file hh.c. Modify this user for Sakia all chown Sakia hh.c This applies hh.c user access to Sakia as owner 2, directory/tmp/sco Change the owner and group of this directory to Sakia and group net Chown-r sakia:net

Chown Modifying the user and user group properties of files and folders
1, to modify the owner of the file hh.c. Modify this user for Sakia all
Chown Sakia hh.c
This applies hh.c user access rights to Sakia as the owner

2, change the directory/tmp/sco owner and group of this directory to Sakia and group net
Chown-r Sakia:net/tmp/sco

chmod modifying file and folder read and write execution properties
1. Modify the hh.c file to a writable, readable executable
chmod 777 HH.C
To modify all file properties under a directory to be writable and readable executable
chmod 777 * *
Replace the folder name with the suffix name *.
Similarly, if you want to modify the properties of all HTM files
chmod 777 *.htm

2, modify the directory/tmp/sco to writable and readable executable
chmod 777/tmp/sco
To modify all folder properties under a directory to be writable and readable executable
chmod 777 *
Replace the folder name with a *.
To modify all files and folders and their subfolder properties under/tmp/sco as writable and readable executable
Chmod-r 777/tmp/sco
Can write w=4
Readable r=2
Executable X=1
777 is to have full access. You can freely combine the permissions of users and groups as needed.


The difference between Linux chown and chmod commands

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.