How to Change File Permission in Linux/Ubuntu Using Chmod Command

In Linux operating system everything is a file , if it is not a file then it’s a process so everything has default permission assigned. File permission defines which file has read,write,execute permission and for which user group.In this article you learn how file permission work and how you change the file permission using chmod command.

How to Copy Files and Directories in Ubuntu.

Linux/Ubuntu File Permission

Before we going to start, go to the terminal (shortcut ctrl+atl+T) and type ls -l

It shows output like this

So start from first column what rwx indicates

r – stands for read permission
w – stands for write permission
x – stands for execute permission
-(dash) – represents no permission is assigned

Beginning of three letter indicates owner permission, then group and next three for anyone else.

Change Files And Directory Permission Through Chmod Command

In Linux operating system  file and directory permission can be changed through chmod command. Here is some of the example of chmod command.

The meaning of above command means i am assigning read, write and execute permission for owner,usergroup and other users.

Like rwx you can represent the permission numerically

4 – read

2 – write

1 – execute

Combination of permission

0 – no permission, this person cannot read, write or execute

1 – execute only

2 – write only

3 – execute and write only (1 + 2)

4 – read only

5 – execute and read only (1 + 4)

6 – write and read only (2 + 4)

7 – execute, write and read (1 + 2 + 3)

Another example

means the file has

owner = read+write+execute permission

group = read+write

other = read

How to Remove Package through Ubuntu Terminal Command.

To learn more about chmod command you take the help of ubuntu manual. Just go to terminal and type

Kumar Singh

About Kumar Singh

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.
Tagged , , . Bookmark the permalink.