Want to know what the numbers in chmod mean? Using flags is an easy and short form to set user permissions. This article(I hope) puts it SIMPLE, if you want to learn the theory, also visit the links in the end.
There are four OCTAL (0..7) digits, which control the file permissions. But often, only three are used. If you use 600 it equals 0600. The missing digit is appended at the beginning of the number.
Permissions:
1 – can execute
2 – can write
4 – can read
The octal number is the sum of those free permissions, i.e.
3 (1+2) – can execute and write
6 (2+4) – can write and read
Position of the digit in value:
1 – what owner can
2 – what users in the file group(class) can
3 – what users not in the file group(class) can
Examples:
chmod 600 file – owner can read and write
chmod 700 file – owner can read, write and execute
chmod 666 file – all can read and write
chmod 777 file – all can read, write and execute
Links:
1) Wikipedia explains that in greater detail: http://en.wikipedia.org/wiki/Filesystem_permissions
2) Main page for chmod: http://linux.die.net/man/1/chmod
Thank you so much for info
i did chmod 600 on a file and it won’t let me open it anymore, saying ‘this file may be damaged’. how do i open it??
600 means that the owner of the file can read and write to the file. Which file are you trying to access? The file might be damaged, but before I can say that without doubt I would have to know what the file path and the file name is.
You probably need to use sudo chown to change the owner to you. 600 means ONLY the owner can read and write.
This was great information! Explained in a simple way.
This is great information! How about an overview of CHMOD 755?