当前位置:网站首页>File permission management
File permission management
2022-07-25 03:08:00 【Zhangshufen~】
1. file type
Linux Think everything is a document .
Ordinary documents “-”
Directory file “d” (directory)
Pipeline files “p” (piping)
Link to the file “l” (link)
Device file ( Block device “b”(block), Character device “c”(char))
Socket file “s” (socket)
Explain what it means ?
Pipeline files : A means of interprocess communication
Link to the file : Soft link ( Character link ) And hard links , Soft links can be considered windows Next shortcut
Device file : Block device : A device that can read a certain length from any position : For example, disk ,U disc ,TF Cards and so on
Device file : Character device : Only one byte per byte can be read , Can't read randomly , For example, mouse , Keyboard and so on.
Socket file : A way of network communication
2. How to check the type of a file ?
Go to the specified directory , adopt ls -l To check :

The first character looks at the file type , such as a.out, The first character is ‘-’, For ordinary documents .
3. File permissions
Divide every three 
rwx What do they stand for ?
r Read permission value :4
w Write permissions value :2
x Executive authority value :1 For ordinary files, it represents execution permission , For catalog files , Delegates have access to
- No authority value :0
4. There are two ways to modify permissions : Text setting method and number setting method
4.1 Text setting
chmod Command to modify permissions
u:user Access rights of the owner ( The owner )
g:group Access rights of the group ( People in the same group as the owner )
o:other Other people's access
a:all All the people
+: Add permissions
- : Remove authority
=: Indicates direct assignment permission
Be careful : If you want to give it to the owner at the same time , Generic group , Others modify permissions , Separate them with commas
First, show the permissions of the current file :

to main2 Modify the permissions of this executable file , Remove the execution permission of the owner , The order is as follows :

Subtract the execution command from the execution permission of the owner x,u-x. Want to give it to the owner at the same time , Generic group , Others modify permissions , Separate them with commas .
![]()
4.2 Number setting method
r:read value 4(100)
w:write value 2 (010)
x:execute value 1 (001)
Through the command chmod xxx filename Make changes ,x Is greater than or equal to 0 Less than or equal to 7.
0 : No authority
1:--x(001)
2:-w- (010)
3:-wx(011)
4:r--(100)
5:r-x(101)
6:rw-(110)
7:rwx(111)
Examples are as follows : From the above file permissions at the beginning , For my convenience, I put the pictures here .

to a.txt The master permission of this file plus the command of execution permission :
chmod 764 a.txt
rw- The value of is 6,x The value of is 1, We add x After permission rwx The value of is 7, Membership group and other permissions remain unchanged .
边栏推荐
- Use pytest + allure to show the chart results (3)
- Innobackupex parameter description
- Beginners must see the markdown User Guide
- 05 - MVVM model
- JS written test question -- browser kernel
- Pypi counts the number of Downloads
- kettle_ Configure database connection_ report errors
- DOM node type
- Function of each layer of data warehouse
- Learning record 10
猜你喜欢

NVM installation and use

Brief understanding of operational amplifier

Eslint error

Use reflection to convert RDD to dataframe

Error: tomee required to support ear/ejb deployment

Flink's study notes

Learning record 12

Pypi counts the number of Downloads

Openlayers ol ext: Transform object, rotate, stretch, zoom in

kettle_ Configure database connection_ report errors
随机推荐
MySQL common function summary, very practical, often encountered in interviews
JS password combination rule - 8-16 digit combination of numbers and characters, not pure numbers and pure English
Nuscenes data set summary
Enter an integer and a binary tree
JS written test question -- realize the flat function of array
Concurrent programming day01
JS written test questions -- random numbers, array de duplication
Hyperchain hyperblockchain Shi Xingguo was interviewed by 36 krypton: the amount of customer cooperation consulting is doubling
Learning record Xi
Page performance: how to optimize pages systematically?
JS written test question -- prototype, new, this comprehensive question
How to switch terminators in PostgreSQL?
Canvas record
Time formatting
Map set learning
Uni app configuration
Riotboard development board series notes (4) -- using Vpu hardware decoding
Banana pie bpi-m5 toss record (3) -- compile BSP
JS foundation -- hijacking of this keyword
Download the jar package of jsqlparser and PageHelper