Chmod command, chmod

Source: Internet
Author: User

Chmod command, chmod

Chmod -- Modify file or directory permissions

ChAnge the permissionsModE of a file

Command path:/bin/chmod

Note: Only root users and file owners can modify permissions.

 

Example 1:

# Chmod644/temp/chmodtest

R (read) -- 4

W (write) -- 2

X (execute) -- 1

Execute the above command to modify the chmodtest File Permission In the/temp/directory to-rw-r --

Example 2:

# Chmod-R 777/temp/

The role of the parameter R is to implement recursive modification permissions. Execute the above command to modify the permissions of the/temp/a directory under the current working directory and all its subdirectories and files to-rwxrwxrwx

 

Raise questions:If the root user creates a directory with 777 permissions and a file with 644 permissions in the directory, can a common user delete files in the directory?

Problem Analysis:

Normal users can delete a file directory because the file directory permission is 777, that is, other users have the write permission on the directory.

Character Permission Meaning of a file Meaning of directory
R Read Permission You can view the File Content List contents in the directory
W Write Permission File content can be modified You can create or delete files in the directory.
X Execution permission Executable files You can enter the Directory

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.