Jump to content

File Permissions: Difference between revisions

 
(7 intermediate revisions by 3 users not shown)
Line 4: Line 4:
== What are file permissions? ==
== What are file permissions? ==


File permissions are important, they specify what you let people do to your files. There are generally three types of file permissions:
File permissions are rather important as they specify what you let people do to your files. There are generally three types of file permissions:


* Read Permission
* Read Permission
Line 32: Line 32:
* Others
* Others


Basically, this means everyone else. e.g. those outside of your group, or another very important example is webpages. You need to specify others to allow people to view your HTML files.
Basically, this means everyone else, eg - those outside of your group. Another very important example is webpages as you need to specify others to allow people to view your HTML files.


* All
* All
Line 79: Line 79:
  -rwxr--r--
  -rwxr--r--


and so on.
and so on. These are the permissions that you've set. There are ten spaces there for characters if you notice. The first 'bit' as we call it, tells us if it's a directory. If there's a 'd' there, then it is a directory, otherwise, if there's a '-' there, then it's a file.
 
These are the permissions that you've set. There are ten spaces there for characters if you notice. The first 'bit' as we call it, tells us if it's a directory. If there's a 'd' there, then it is a directory, otherwise, if there's a '-' there, then it's a file.


Now, divide the remaining nine characters into three groups of three. The first group of three represent the permissions for 'user', the next three for 'group' and the last three for 'others'. The first 'bit' of any of these three groups represent whether that group has 'read' permission (a '-' means no). The next bit means 'write' permission, and the third bit means 'execute' permission.
Now, divide the remaining nine characters into three groups of three. The first group of three represent the permissions for 'user', the next three for 'group' and the last three for 'others'. The first 'bit' of any of these three groups represent whether that group has 'read' permission (a '-' means no). The next bit means 'write' permission, and the third bit means 'execute' permission.
Line 114: Line 112:


You can get more detailed information on chmod by typing man chmod at the prompt and of course, contact [[Helpdesk]] if you have any problems.
You can get more detailed information on chmod by typing man chmod at the prompt and of course, contact [[Helpdesk]] if you have any problems.
== lil_cain and file permissions ==
One day in #lobby, lil_cain, at this point an elected systems administrator, decided he was having trouble with Linux and asked the kind people of RedBrick for help. His question was something along the lines of "how do I check the permissions for a file in a directory?"
Now, as everyone knows, you can check the permissions of all files in a directory using either
ls -l
or
ls -al
ls is one of the most basic commands EVAR!!1!!!11 lil_cain U DESERVE NO R00T!1!!
<-->
Actually, what I was looking for is stat. It's a far better tool for individual files.
<--->
Orly? I just remember "thanks".
[[Category:Helpdesk]]
244

edits