Understanding Linux file permissions

Here. By Mayank Sarup.

What do “read”/”write”/”execute” mean?

r – Read permission. Whether the file may be read. In the case of a
directory, this would mean the ability to list the contents of the
directory.

w – Write permission. Whether the file may be written to or modified. For
a directory, this defines whether you can make any changes to the contents
of the directory. If write permission is not set then you will not be able
to delete, rename or create a file.

x – Execute permission. Whether the file may be executed. In the case of a
directory, this attribute decides whether you have permission to enter,
run a search through that directory or execute some program from that
directory.

Examples of and related commands

chmod u-x,g+w,o+rw somefile

chmod xyz filename

(r = 4; w = 2; x = 1)

chown new-owner somefile

chgrp new-grp somefile

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: