Thursday, September 3, 2009

Linux Permissions

In linux the way we usually give permissions is by providing the command chmod 777 yourfile. This gives everyone read,write and execution privileges. But there is a better way to give permissions. Its as follows;

chmod u=rx file (Give the owner rx permissions, not w)
chmod go-rwx file (Deny rwx permission for group, others)
chmod g+w file (Give write permission to the group)
chmod a+x file1 file2 (Give execute permission to everybody)
chmod g+rx,o+x file (OK to combine like this with a comma)

Thanks Sanjeewa for the permission related info. One more thing he added was not to use the "cat"
command but to use "less" to view files because when you use "cat" linux puts it in a memory
buffer before displaying it on the screen.

No comments:

Post a Comment