What is the attributes of Linux files? 2023

By XiaoXin
A Bit Randomly

PHP (PHP: Hypertext Preprocessor recursive abbreviation) Chinese name is: "Hypertext Preprocessor ", is a widely used general-purpose open-source scripting language, suitable for Web site development, it can be embedded in... Read What is PHP, what can PHP do, why use PHP?

Main Contents

What is the attributes of Linux files?

-rw-r--r-- that is the permission symbol, a total of - --- --- these bits.

The first short horizontal part is the file type identifier: - means ordinary file; c means character device (character); b means block device (block); d means directory (directory); l means link file (link); One three consecutive dashes are the user permission bit (User), the second three consecutive dashes are the group permission bit (Group), and the third three consecutive dashes is the other permission bit (Other). Each permission bit has three permissions, r (read permission), w (write permission), x (execute permission). If each permission bit has permission, then the situation of full permission is: -rwxrwxrwx; the situation of empty permission is ---- --- ---.

You can use the chmod command to set the authority, and its format is:
chmod ugoa+/-/=rwx filename/directory. Ex: 

A file aaa has completely empty permissions --- --- ---.

chmod u+rw aaa (set the read and write permissions for the user permission bits, and the permissions are expressed as: - rw- --- ---)

chmod g+r aaa (set permissions to the group as readable, and its permissions are expressed as: - --- r-- ---)

chmod ugo+rw aaa (set permissions for users, groups, and other users or groups to read and write, and the permissions are expressed as: - rw- rw- rw-)

If aaa has full permissions - rwx rwx rwx.

chmod ux aaa (remove the user's executable permission, the permission is expressed as: - rw- rwx rwx)

If you want to grant specific authority to aaa - rwx rx rx, the command is:

chmod u=rwxgo=rx aaa

Continuing...

Please Share This Article Thank You!

Parts of Top Latest PHP Interview Questions And Answers For Experienced
Explain find command in Linux

1: find / -name "filename" Searches for files in the directory structure and performs the specified operation. 2:grep  3: local file name--- this is another way of writing 'find -name', but it is much faster than the ...

Linux: Explain the purpose of the following 10 shell commands

top:ps: mv: find: df: cat:chmod: chgrp: grep: wc: top, ps, mv, find, df, cat, chmod, chgrp, grep, wc top: The command is a commonly used performance analysis tool under Linux, which can d...