Simple rule for remembering numeric permissions in *nix

I don’t intend to give you another rehash of how file permissions work in Unix/Linux (*nix for short). After all, this is been done many times in the past and much better than I could ever do it. All I want to do here is to show you how I personally remember how which number corresponds to what numeric permissions.

All I have to do is remember 0 through 4 (just without 3).

0 is, of course, no permission. 1 is execute, 2 is write, 4 is read. All I need to do is remember that as I go up in the numbers the effect is “less important”. Execute is most important, after all, so it gets the lowest number. Then writing: less important than executing wouldn’t you say? So it gets the next highest number, 2. Reading is the “least important”, so it gets 4.

Whats great about these numbers is that they add up uniquely. If I want to give permission to write and read, that’s 2+4=6. Permission to execute and write? 1+2 = 3.

Leave a Reply

Your email address will not be published. Required fields are marked *