Chmod Command – Change File Permission in Linux/Ubuntu

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 Command with Examples .

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.

Chmod Command – Change Files And Directory Permission

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

Above command assigns read, write and execute permission to owner,usergroup and other users.

Numeric representation of read,write and execute permission.

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)

How to create new files using Touch command.

Another example

Using above command we have give following permissions.

owner = read+write+execute permission

group = read+write

other = read

How to Remove Package through Ubuntu Terminal Command.

Apply read,write,execute permission to all files under directory recursively

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.

One Response to Chmod Command – Change File Permission in Linux/Ubuntu

  1. Pingback: How to Copy File,Directory on Ubuntu Using CP Command

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">