Unix File Permissions

Article by on April 1, 2012, last modified on May 6, 2013

For future reference:

7 rwx
6 rw-
5 r-x
4 r--
3 -wx
2 -w-
1 --x

I will add more info in the future about chmod. (Really, I should move this to be an article.)

Read about sticky bits:

http://h3g3m0n.wordpress.com/2007/04/17/linuxunix-permissions/

http://linux-tipps.blogspot.com/2008/07/directory-rights-in-linux.html

Extended Attributes

You can tell if a file has an extended attribute by using the -l flag on ls, such as:

$ ls -l /usr/lib/python2.5/site-packages/include_server
-rw-r--r--@ 1 root wheel 2.6K Jun 6 09:38 roman.py

To see what the attributes are, use the xattr command as follows:

$ xattr /usr/lib/python2.5/site-packages/include_server/roman.py 
com.apple.quarantine

To remove an attribute, use the -d flag and specify the attribute to remove:

$ sudo xattr -d com.apple.quarantine /usr/lib/python2.5/site-packages/include_server/roman.py

References:

http://superuser.com/questions/87467/what-does-the-in-ls-al-mean

http://stackoverflow.com/a/4833168/990642

Further Reading

  • http://linuxfocus.berlios.de/English/January1999/article77.html
Older Articles ยป