LS, ls-l, ls-al, ll commands in Linux

Source: Internet
Author: User

LS is just a simple list of filenames, ll more detailed list of file type, file owner permissions, file owner group permissions, file size, file last modified time, etc ...

We can use a simple diagram to illustrate, such as 1:

Figure 1

1, the first place on "-", the ordinary file.

2, rw-, indicates that the file owner has read and write permissions to the Text.txt file (x position is "-" indicates no execute permission)

3, rw-, indicates that the file owner's group has read and write permissions to the Text.txt file (x position is "-" indicates no execute permission)

4, r--, indicates that other users have only read permission to the file

Note: rw-, rw-, r--, 3 bits per 3 bits read. R: Indicates Read permission, W: Indicates Modify permission, x: Represents execute permission

1) How do I modify file permissions?

U: Current user permissions, G: Permissions for current user group, O: Current Other user rights

Example: a) Add execute permissions to the current user

1 chmod u+x text.txt

b) Add write permissions to the current user group

1 chmod g+w Text.txt

c) Add read permissions to other users

1 chmod o+r Text.txt

2) How do I modify the file owner?

Example: Modifying the owner to WM

1 chown Linux WM

3) How can I modify the group that the file belongs to?

Example: Modifying an owning group to a GRP

1 chgrp Linux grp

Original address: http://www.cnblogs.com/nchar/p/3905660.html

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.