You are here
Home > Redhat > File Permissions

File Permissions

Read      = 4

Write     = 2

Execute = 1

 U             G             O

rwx         rwx          rwx                There are 3 permissions that is User, Group & Others

 7              7             7

#ls -l

-rw-r–r–    1 root root        352 Aug 25 18:13 a1.html

Here file a1.html has the permission 644

_____________________________________________________________________________________

Chmod

chmod command is used to set permission for the files.

Eg:-Numeric way of assigning permission to a file.

       # chmod 640 ab.txt

       # chmod 666 ac.txt

       # chmod 755 ad.txt

Eg:- Symbolic way of assing permission to a file.

       # chmodugo+x ab.txt

       # chmod u=w,g=wx,o=x dd.txt

       # chmod u-wx,g-x,o-rw ac.txt

_____________________________________________________________________________________

chown

Changing the userowner ship of a file or a directory.

       # chown<User Name><File Name>

       # chown smartsample.txt

-R option is used for recursive mainly for directories and have subdirectories

       # chown -R smart /backup

_____________________________________________________________________________________

chgrp:

Chaging a group of a file or a directory

       # chgrp raj1 abc.txt

       # chgrp raj2 /ll

       # chgrp -R raj2 /mnb1 (recursively for subdirectories)

 

Leave a Reply

13 − five =

Top