The three groups of notations are shown below. Symbolic and octal permission notations for owner, group, and everyone.
For example, let's say you've downloaded a piece of software you want to share with other people on your system. If the file is large it would be a waste of resources to have everyone who wanted to use the software download their own copy.
It would be much better to have one person download the software and change the permissions so everyone on that system could access the file. Or perhaps you've uploaded some software and you need to change the file permission so you can run it.
Finding the current permissions Typing ls -ld at the host system prompt will show you the permissions of your home directory, with a string of 10 characters that should look something like drwx or drwx--x--x.
The first character is what type of entry you're looking at, either d for directory or - for a plain file. The rest of the characters are broken up into fields of three. The first set of three represent the owners permissions, the second set of three represent the group permissions the use of group permissions varies from system to system.
They are not generally used on UW Uniform Access systemsand the third set of three representing the "other" permissions. The "other" category encompasses everyone else and is usually called world, which I will use for the rest of this article.
The first character of each set represents read r which allows read access to the file. The second character of each set represents write w which allows changes to be made to the file, including deletion. The third character of each set represents execute x which allows running the file.
A dash - in any entry means no permission for that operation. So, the first example of the ls -ld command drwx means the entry is a directory in which the owner has read, write and execute permissions and no one else has any permissions. The second example of the ls -ld command drwx--x--x is a directory it happens to be my home directory on Hawking in which the owner has read, write, and execute permissions, the group has execute permissions and everyone else world has execute permissions.
How to change permissions The format of the chmod command is chmod [permission] [filename]. The permission can be specified in either the symbolic or absolute mode. In the symbolic mode you must specify three things. To remove world read permission from a file you would type chmod o-r [filename].
Sound a bit complex?
There is an alternative. All you have to do is remember a couple of numbers and you can use the absolute mode to change permission. The absolute mode uses 3 numbers to represent the permission.So in the example above you see that it is a file and the user (owner) had read, write and execute permissions, the group has read and execute permissions and others have the same as the group.
chmod . When set for a directory, this permission grants the ability to read the names of files in the directory, but not to find out any further information about them such as contents, file type. Want to know what the numbers in chmod mean? Using flags is an easy and short form to set user permissions.
This article puts it SIMPLE, if you want to learn the theory, also visit the links in the end. I am looking for the chmod command to allow all users read and write permissions to a specific directory.
I have done chmod for a file but I need this for a directory. This . Using chmod's help flag from the command line $ chmod -h Checking the man pages for chmod from the command line $ man chmod Websites: If all else fails Stack Overflow and Super User are always a good source of info along with well respected q and a.
chmod u=rwx attheheels.com sets read, write and execute permission just for the owner (the permissions for the group and for others remain unchanged). chmod go-w attheheels.com removes write permission for the group and for others, leaving the permissions for the owner unchanged.