Share Linux-chown instruction usage examples

零下一度
Release: 2017-06-25 10:12:12
Original
2359 people have browsed it

chown [chang owner]: Change the owner of the file, that is, change the owner of the specified file to another specified user or group.

Command format:

chown [option]... [user][:[group]] file...

Example: sudo chown book:book /work -R

-R[recursion]: Recursively change all files in the directory

Generally, no When using the above command, the subdirectory work is owned by the root user and root group.

Enter the ls -ld work command, and then list the details of the work directory. As can be seen from the figure below, the directory permissions are all managed by root.

After using sudo chown book:book /work -R, the work directory and all members in the work directory will belong to the book user and book group As shown below, enter the ls -ld work command again. You can see that the permissions of the work directory are managed by book, so that the book user can write files and read files.

The above is the detailed content of Share Linux-chown instruction usage examples. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!