Wednesday, September 27, 2006

File Permissions -- Solaris

To change the mode on a file or directory. I prefer the octal (0-7) format.

r -- read (has value of 4)
w -- write (has value of 2)
x -- execute (has value of 1)

rwxrwxrwx chmod 777 filename
rw-rw-rw- chmod 666 filename
r--r--r-- chmod 444 filename
-w--w--w- chmod 020 filename
--x--x--x chmod 001 filename
--------- chmod 000 filename

To make it recursive, use the -R option.

e.g. #chmod -R 777 directoryname

No comments: