In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the use of linux chown command to change the file or directory users and user groups, I hope you will learn a lot after reading this article, let's discuss it!
Linux/Unix is a multi-user and multi-tasking operating system, and all files have owners. Use the chown command to change the owner of the specified file to the specified user or group, the user can be a user name or user ID, the group can be a group name or group ID, the file is a list of files to change permissions separated by spaces, and wildcards are supported. Generally speaking, this directive is only used by system administrators (root), and ordinary users do not have the right to change the files and groups to which they belong.
Syntax format: chown [parameters]
Common parameters:
-R makes the same owner change to all files and subdirectories in the current directory-c shows the change action only if the file owner has indeed changed-f if the file owner cannot be changed, do not display an error message-h only make changes to the link, not the file that the link actually points to-v shows the details of the owner's change-help display auxiliary instructions-version display version
Reference example
Change the test.txt file user group and users to bin:
[root@linuxcool] # ll test.txt.bz2-rw-r--r-- 1 root root 56 Jul 22 20:17 test.txt.bz2 [root@linuxcool] # chown bin:bin test.txt.bz2 [root@linuxcool] # ll test.txt.bz2-rw-r--r-- 1 bin bin 56 Jul 22 20:17 test.txt.bz2
Show change actions:
[root@linuxcool ~] # ll test.txt-rw-r--r-- 1 root root 45 Jul 22 21:11 test.txt [root@linuxcool ~] # chown-c bin:bin test.txt changed ownership of `test.txt' to bin:bin
Change the owner of all files in the current directory to linuxcool and the user group to linuxcoolgroup:
[root@linuxcool] # chown-R linuxcool:linuxcoolgroup * after reading this article, I believe you have a certain understanding of using linux's chown command to change files or directories. Users and user groups want to know more about it. Welcome to follow the industry information channel. Thank you for reading!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.