Linux from getting started to mastering the permissions of files in--linux

Source: Internet
Author: User

I. Significance of the existence of file permissions

setting permissions on a file is one of the most basic security settings for Linux, because Linux is a multi-tasking operating system, and it is likely that many different people are using the same host, in order for the security file permission mechanism to be required, it ensure that the file can be used by the user to do the appropriate action, but also ensure that the file will not be unavailable to users to operate.

Two. View of file permissions

The commands used are:

Ls-l file or ll file

Ls-ld dir or ll-d dir # # ll=ls-l # #

Three. Read the file permissions

From a line of string examples, specifically analyze what the permissions information contains:


D |rwxr-xr-x|    2 |  Root |  Root |  6 | Jul 22 02:48 | /mnt

[1] [2] [3] [4] [5] [6] [7] [8]


[1] Type of file

-# #空文件, or text
D # #目录
L # #软链接 is similar to a shortcut, opening this file actually opens the source file
S # #socket sockets, the program is closed, the socket is the interface of the program's external interaction
B # #block block device after external device is plugged in
C # #字符设备

[2] Permissions for files

Rwx|r-x|r-x
1 2 3

1.[u] What the file owner can do with the file
2.[G] File What can all groups do with files
3.[o] What other people can do with files


[3] File: Number of hard links to files (the number of times the contents of the file have been recorded by the system)
To directory: The number of subdirectories in a directory

[4] owner of the file

[5] All groups of files

[6] To file: File size
To directory: the size of the subdirectory file metadata (matedate); The metadata is a property of the file # # #每个字符是一个字节, file name one character is a byte # # #

[7] time when the contents of the file were modified

[8] Name of the file

Linux from getting started to mastering the permissions of files in--linux

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.