Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the chown command in Linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to use the chown command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

The Linux common command chown changes the owner and the group to which a file or directory belongs. This command can authorize a user to become the owner of a specified file or to change the group to which the file belongs.

Chown is used to change the owner or group of a file or directory.

Add that the user can be user or user D, and the user group can be group name or group id. File names can make a list of files separated by spaces, and wildcards can be included in the file name.

Only file owners and superusers can use this command.

Syntax chown (option) (parameter) option-c or-- changes: the effect is similar to the "- v" parameter, but only returns the changed part;-f or-- quite or-- silent: does not display an error message;-h or-- no-dereference: modifies only symbolic linked files and does not change any other related files;-R or-- recursive: recursive processing that processes all files and subdirectories under the specified directory together -v or-- version: show the instruction execution process;-- dereference: the effect is the same as the "- h" parameter;-- help: online help;-- reference=: all set the owner of the specified file or directory and the owner of the reference file or directory to the same group as the group;-- version: display version information. Parameter user: group: specify owner and subordinate workgroup. When ": group" is omitted, only the file owner is changed; file: specifies the list of files to change the owner and workgroup. Multiple files and targets are supported, and shell wildcards are supported.

For example, change the file master of the directory / usr/meng and all its files and subdirectories to liu:

Chown-R liu / usr/meng Thank you for reading this article carefully. I hope the article "how to use chown commands in Linux" shared by the editor will be helpful to you. At the same time, I also hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report