Linux ls, ls -l, ls -l, ll command

  

ls is simply a list of file names in the directory, ll more detailed list of file types, file owner permissions, file owner group permissions , file size, file last modified time, etc...

We can use a simple diagram to illustrate, as shown in Figure 1:


1, first place Just "-", for ordinary files.

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

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

4, r--, indicating that other users are on the file Only read permissions

Note: rw-, rw-, r--, 3 bits per 3 digits. r : indicates read permission, w : indicates modify permission, x : indicates execution permission

1) How to modify file permissions?

u : Permissions of the current user, g : Permissions of the current user group, o : Current other user permissions

Example: a) Add execution permission to the current user

1 Chmod u+x text.txt

b) Add write permission to the current user group

1 chmod g+w Text.txt

c) Add read permission to other users

 1 chmod o+r Text.txt

2) How to modify the file owner?

Example: Modify the owner to wm

1 chown linux wm

3) How do I modify the group to which the file belongs?

Example: Modify the group to grp

1 chgrp linux grp


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

Copyright © Windows knowledge All Rights Reserved