Question on chmod in UNIX

1

What does chmod 654 stand for ?

Ramprasad

Posted 2010-08-30T10:34:24.673

Reputation:

1(reference) http://linux.die.net/man/1/chmod or just man chmod in your shell – None – 2010-08-30T10:36:33.057

Answers

13

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.

Tatu Ulmanen

Posted 2010-08-30T10:34:24.673

Reputation: 243

3It'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. – JaHei – 2010-08-30T13:37:53.610

1

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

miku

Posted 2010-08-30T10:34:24.673

Reputation: 422

1

Change permissions to rw-r-xr--.

Here's a chmod calculator:

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

cyphorious

Posted 2010-08-30T10:34:24.673

Reputation: 381

1

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!

Daenyth

Posted 2010-08-30T10:34:24.673

Reputation: 5 742