Differences between linuxchown and chmod

Source: Internet
Author: User
The difference between linuxchown and chmod-Linux general technology-Linux technology and application information. The following is a detailed description. Chown modify user and user group attributes of files and folders
1. Modify the owner of the hh. c file to all the users of the sakia.
Chown sakia hh. c
In this way, the user access permission of hh. c is applied to sakia as the owner.

2. Change the owner and group of the directory/tmp/sco to saworkflow and group net.
Chown-R sawn: net/tmp/sco

Chmod modifies the read/write execution attributes of files and folders
1. Change the hh. c file to writable, readable, and executable.
Chmod 777 hh. c
To modify the attributes of all files in a directory to writable and executable
Chmod 777 *.*
Replace the folder name with the suffix.
Similarly, if you want to modify the attributes of all htm files
Chmod 777 *. htm

2. Change the directory/tmp/sco to writable and readable and executable.
Chmod 777/tmp/sco
To modify the attributes of all folders in a directory to writable and executable
Chmod 777 *
Replace the folder name *.
To modify the attributes of all files and folders in/tmp/sco and Their subfolders to writable, readable, and executable
Chmod-R 777/tmp/sco
Writeable w = 4
Readable r = 2
Executable x = 1
777 means that you have full permissions. You can freely combine user and group permissions as needed.

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.