Get the App
SLTechnology News&Howtos  ›  Servers  › 

File authority and detailed explanation of main subordinate group

Shulou Source: shulou.com Published: 2022-06-02 16:08:17 09月22日 Update

1. File permissions 1. File attribute

two。 The permissions of files are mainly defined for three types of objects.

Owner: owner, u

Group: belonging to group, g

Other: other, o

3. Each file defines three permissions for each type of visitor.

R: Readable, read

W: Writable, write

X: eXcutable, execute

(1) for documents

R: you can use the file view class tool to get its contents

W: its content can be modified

X: you can ask the kernel to start this file as a process

(2) for catalogs

R: you can use ls to view a list of files in this directory

W: files can be created or deleted in this directory

X: you can use ls-l to view the file metadata in this directory (with r), and you can enter this directory by cd

X: only give directory x permission, not file x permission

4. File permission list

5. Modify file permissions command

(1) chmod [OPTION]... MODE [, MODE]... FILE...

MODE:

Modify all permissions for a class of users:

U = g = o = ug= a = upright department g =

Example:

Modify certain bit or bit permissions for a class of users

U + u-g + g-o + o-a + a-+-

Example:

(2) chmod [OPTION]... -- reference=RFILE FILE...

Refer to the permissions of the RFILE file, and modify FILE to be the same as RFILE

Example:

(3) chmod [OPTION]... OCTAL-MODE FILE...

Parameters and examples:

-R: recursively modify permissions

(4) modify permissions according to the numerical representation in the file permission list

Example:

Second, document owners and subordinate groups 1. The owner of the modified file: chown

(1) chown [OPTION]... [OWNER] [: [GROUP]] FILE...

Usage:

OWNER

OWNER:GROUP

: GROUP

Note: the colon in the command is available. Replace

-R: recursive

(2) chown [OPTION]... -- reference=RFILE FILE...

two。 Modify the group of the file: chgrp

Previously, you have demonstrated changing the owner while changing the group through the chown command. The following shows the command to change the group separately.

(1) chgrp [OPTION]... GROUP FILE...

(2) chgrp [OPTION]... -- reference=RFILE FILE...

(3)-R recursion

Tags: Files permissions directories examples commands recursion content users demos kernels colons parameters available in at the same time objects properties tools passed numbers data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Technology vpn Shulou Information MariaDB