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

The method of modifying File attribute and permission in linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

We know the importance of file permissions to the security of a system, and we also know the relevance of file permissions to users and groups, so how to modify the properties and permissions of a file?

Here we introduce several instructions that are commonly used for permissions for groups, owners, and various identities. As follows:

Chgrp: change the group to which the file belongs

Chown: change the file owner

Chmod: change the permissions of files, SUID, SGID, SBIT, and so on.

1. Change the group chgrp

[root@www] # chgrp [- R] dirname/filename...

Options and parameters:

-R: continuous recursive changes, that is, all files and directories in the subdirectory are updated to this group. It is often used to change all files in a directory.

Example:

[root@www ~] # chgrp users install.log [root@www ~] # ls-l-rw-r--r-- 1 root users 68495 Jun 25 08:53 install.log [root@www ~] # chgrp testing install.log chgrp: invalid group name `testing'

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

Servers

Wechat

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

12
Report