Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can modify the files with 777 permissions, but not with 755. I do it by sourcing some sed commands. I find it odd because I can modify the files with even 700 permissions in Vim.

Why is it not possible to modify files with 755 permssions? Do basic unix-tools, such as sed, awk and find, require 777 permissions?

share|improve this question
what permissions does the account your on have? – John T Aug 10 '09 at 2:48
up vote 12 down vote accepted

Permissions on UNIX and UNIX-like systems work as follows...

rwxrwxrwx = 777

You will notice there are 3 'sets' of rwx. These are designated for:

  • user
  • group
  • other

user - the person who has ownership of the file/directory.
group - if a group has control over a specific set of files, and you are in that group, you inherit the permissions assigned to that group.
other - you fall into neither of the above categories.

A more graphical representation:

uuu | ggg | ooo
rwx | rwx | rwx
 7  |  7  |  7

What does 777 come from you might ask?

Read permission (r) - 4
Write permission (w) - 2
Execute permission (x) - 1

each seperate number in the 3-digit sequence represents the user,group, and other categories in that exact order. If the number is 777 for example, everyone has full access to the file. If it is 111, everyone only has execute access.

With files that have 755 permissions, if you are not the owner of the file, you only have read and execute permissions. You will not be able to write to these files. For the files with 700 permissions, you can probably write in these because you created them yourself. The umask command will tell you the number you can subtract from 777 to see what permissions files are created with by default on your system.

share|improve this answer
Holy crap I never realized the the Unix permissions were designed for bitmasking. – Lucas McCoy Aug 10 '09 at 3:22
+1 for a great explanation. – EBGreen Aug 10 '09 at 3:23
Bitmasking is by far the easiest way to write code to handle combinations of yes/no possibilities. – EBGreen Aug 10 '09 at 3:25
wondering what the downvote was for so i can correct it O_o – John T Aug 10 '09 at 4:14

Have you checked the ownership of the files with 755 permissions?
You have to be the owner of these files to be able to 'write' to them.

You are very likely owning the files with 700 permissions,
which would explain your ability to write to them.

       --- controls for Others
    ---    controls for Group
 ---       controls for User or Owner
share|improve this answer
rmw? Read/modify/write? Not exactly. – bk1e Aug 10 '09 at 3:01
@bk1e, typos happen when one gets sleepy :-), the rest of the information was correct I guess. And, I also fixed it soon. – nik Aug 10 '09 at 4:25

Use the famous Online CHMOD Calculator, it works great and is VERY interactive:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .