Linux-Common commands (2) permission management commands, linux-permission management

Source: Internet
Author: User

Linux-Common commands (2) permission management commands, linux-permission management

Permission management command: chmod

Command name: chmod

Command: change the permisssions mode of a file

Command path strength:/bin/chmod

Execution permission: All Users

Function Description: Create a new directory-p recursive Creation

Syntax: chmod [{Ugoa}{+-=}{Rwx}] [File or directory]

[Mode = 421] [File or directory]

-R recursive Modification

Number of Permissions

R ---- 4

W ---- 2

X ---- 1

Rwxrw-r --

7 6 4

Example:

$ Chmod g + w testfile

Grant the write permission to the group to which the file testfile belongs.

$ Chmod-R 777 testdir

Modify the directory testdir and the files in the directory to grant all permissions to all users.

----------------------------------------------------------------------------------

Permission management commands: Chown

Command name: chowm

Command: change file ownership

Command path strength:/bin/chown

Execution permission: All Users

Function Description: Change the owner of a file or directory.

Syntax: chown [user] [file or directory]

----------------------------------------------------------------------------------

Permission management commands: Chgrp

Command name: chowm

Command: change file group ownership

Command path strength:/bin/chowm

Execution permission: All Users

Function Description: Change the group to which a file or directory belongs.

Syntax: chown [user] [file or directory]

----------------------------------------------------------------------------------

Permission management commands: Umask

Command name: umask

The user file-creation mask

Command path strength: shell built-in commands

Execution permission: All Users

Function Description: displays and sets the default permissions for files.

Syntax: umask [-S]

-S: displays the default permission for creating a new file in rwx format





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.