Files directory and properties under Linux

Source: Internet
Author: User

File type: the

-: Normal file

D: Catalogue

C: Character devices, such as display keyboard and mouse

B: Block device, disk, USB drive, etc.

L: Soft Connection file, similar to the shortcut in win, only records the path of a file

S: Inter-process communication files

P: Pipe file, the output of one command as input to another command


The first three represents the owner of the file

The second three represents the group to which this file belongs

The third three indicates that this file has permissions for someone other than the group to which the primary belongs

RWX indicates a readable and writable executable

Number indicates how many files use the same inode number

The next two shows who the owner is and who belongs to the group


Command: Chown (change the owner and the genus Group)

How to use: Chown: Genus group file name or Chown owner. Genus Group File name

Chown Longfei:user1 1.txt

Chown-r longfei.user1 111 (Change all directories and files under the 111 directory to LongFei and User1)


Command history:

Command: History view historical information used by commands

Such as! LS Linux will look for a command in command history that starts with the nearest LS and runs the command


Change File Special permissions

Command: chattr (add special permissions to the file)

How to use:

Chattr +a 1.txt (add a permission to 1.txt files; files with a permission can only be re-mirrored)

Chattr +i 1.txt (add I permissions to 1.txt files, files with I permissions will be locked, cannot be modified rename delete operations)

Command: lsattr (special permissions to view files and directories layered)

How to use:

Lsattr-r (Ability to list special permissions for files under subdirectories and subdirectories)

Lsattr-d 111 (View special permissions for directory 111 itself)



Files directory and properties under 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.