how to change file permissions in Linux

To set  permissions on File, directory and device to allow or deny access to Users , access is can be given by the chmod command.
Command Syntax:  chmod  permissions file & folder name

There are 2 ways to use the command -

1.Symbolic mode

2. Absolute (Numeric) Mode

Symbolic Mode

In the Absolute mode permissions  can be changed In the symbolic mode , It makes use of mathematical symbols to modify the  permissions

Assigning Permission method

+      ---       Add access

-       ---       Remove access

=      ---       Access explicitly assigned

Level of permission

u       ---      User access

g       ---       Group access

o       ---        Other system user's access

a       ---       To All

Permissions

r      ---        Permission to read a file

w    ---       Permission to delete or modify a file

x     ---         Permission to execute a file

Absolute(Numeric) Mode

In this mode file permissions are not represented as characters but a three digit octal number.

below are gives numbers for all for permissions types.

0  --- no permission

1 --- execute

2 --- write

4 --- read

Now Run the below command to to check and set the permission 

$ls - l fils/folder name



Above U- user permission filed , G-Group permission filed, O-Others permission filed

Set Permission using Symbolic Mode

$sudo chmod u+x,g-w,0+w files/folder name



Set Permission using Absolute(Numeric) Mode


how to change file permissions in Linux how to change file permissions in Linux Reviewed by TecGeeks on May 16, 2016 Rating: 5

No comments:

Get Your Business Online Now


Powered by Blogger.