MayfieldGlobal

Everything from operating systems, programming to web development and more.

Jan
10

How do I change the access permissions for a file or directory using chmod?

Posted under Linux, Shell

The chmod (change mode) command is used to set file and directory permissions in Linux operating systems. The most common use of chmod is to grant or revoke read (r), write (w) or execute (x) permissions for an owner / user (u), a user group (g) or other / anonymous (o) users. Below is a depiction of a typical permissions set for a file:

read permissions for owner / user (u)
|write permissions for owner / user (u)
||execution permissions for owner / user (u)
||| read permissions for other / anonymous (o)
||| |write permissions for other / anonymous (o)
||| ||execution permissions for other / anonymous (o)
||| |||
-rwxr-xr-x
| |||
| ||execute permissions for user group (g)
| |write permissions for user group (g)
| read permissions for user group (g)
file/directory ("-" for file "d" for directory)

Current permissions information may be obtained by using the terminal command:
Read the rest of this entry »