Linux file permissions

Source: Internet
Author: User

each Linux files have four access rights: readable (r) 4, writable (W) 2, executable (x) 1, and no Permissions (-)

-   rw- r-- r-- 1 root root 7 20:21 monitor_log.sh

first column: File type -Indicates that file D represents a directory

2-4-bit: Permissions for file owners

5-7-bit: Permissions for the group to which the file belongs

8-10-bit: Other user rights

Second column: Connection occupancy node

Column three: The main file belongs to

Fourth column: Group to which the file belongs

Fifth column: Size of File

VI, seven or eight columns: Last Modified date (month date time)

Nineth Column: File name

1. Change read and write execution permissions for a file Chmod:chmod 777 Test.txt

-R parameter for cascading

2. Change the file (directory) belongs to group: CHGRP [group name] [filename] can only change the directory itself and directories or files under the directory does not change the-r option can be implemented


3. Change the file's owning primary Chown:chown [-r] Account name file name

Chown [-r] Account name: Group name File name (-R acting on directory purpose is cascade change)

4.umask (set permission complement)

5.chattr (modify file special attributes)

+-= Increase reduction setting

' A ' atime cannot be modified after adding this attribute to the file or directory

' S ' writes data synchronously to disk

' A ' can only append cannot be deleted (non-root user cannot set)

' C ' automatically compresses the file (it will be extracted automatically when read)

' I ' makes the file cannot be deleted, renamed, set Link, write, new data

This article is from the "Exclusive View" blog, please be sure to keep this source http://molujiang.blog.51cto.com/9742572/1878437

Linux file permissions

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.