Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What does chmod 654 stand for ?

share|improve this question

migrated from stackoverflow.com Aug 30 '10 at 10:39

This question came from our site for professional and enthusiast programmers.

1  
(reference) linux.die.net/man/1/chmod or just man chmod in your shell –  Gordon Aug 30 '10 at 10:36
add comment

4 Answers

From http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation:

0 --- no permission
1 --x execute 
2 -w- write 
3 -wx write and execute
4 r-- read
5 r-x read and execute
6 rw- read and write
7 rwx read, write and execute

First number represents the owner, second the group and the third everyone. So 654 would mean read and write for owner, read and execute for group and only read for everyone else.

share|improve this answer
3  
It's simple math really, and pretty handy to know in some cases. Execute is 1, write is 2, read is 4. The resulting permissions are additions of these three. Maybe it was clear from that table, but I myself didn't really think of it at first. Voting up your answer. –  Mikael E Aug 30 '10 at 13:37
add comment

It stands for -rw-r-xr--. See also the chmod man pages.

share|improve this answer
add comment

As others have said, it's rw-r-xr--, which gets stored as a series of bits, 110101100. Split that into user, group, owner blocks and you get 110 101 100. Representing those binary numbers as octal gets you 6 5 4. Tada!

share|improve this answer
    
+1: Very nicely explained! –  Dave Sherohman Jun 28 '11 at 9:24
add comment

Change permissions to rw-r-xr--.

Here's a chmod calculator:

http://www.happytec.at/tools/chmod.php

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.