Re: file permissions
- From: Yuki Cuss <celtic@xxxxxxxxxx>
- Date: Fri, 27 Jan 2006 12:02:53 +1100
Ray Canzius wrote:
G'day all,
I am new to Ubuntu and I am having problems finding out how to change file permissions. Anybody give me any clues.
Regards
Ray
Ray,
If you're using a console, it's quite simple:
chmod [ugo][+-][rwx] FILEs
Let me explain: in the `ugo' bit, it stands for `user', `group' and `others'. `rwx' stands for `read', `write' and `eXecute'.
Let's say you want to deny `others' (that is, everyone not in your group, and who is not you) permission to write to your file; rightly so. The command would be this:
chmod o-w my_file
How about, you want to give yourself access to read, write and execute?
chmod u+rwx my_file
Note that `execute' permissions are only useful on a) directories, and b) programs or scripts. You can also string these little bits together, like so:
chmod +r,go-w,u+w,-x my_file
By omitting the `ugo' parts, you imply it's all. This command above gives *everyone* read access, takes away `group' and `others' permissions to write, gives *yourself* write access, and gives no one execute access (presumably it is not needed).
To look at permissions on a file, type `ls -l my_file'. For example:
celtic@xyrias:~$ chmod +r,go-w,u+w,-x my_file celtic@xyrias:~$ ls -l my_file -rw-r--r-- 1 celtic celtic 17 2006-01-27 12:00 my_file celtic@xyrias:~$
Here, we can see that: a) `celtic' is the owner of the file, b) `celtic' is the group of the file, and the permissions. The permissions are written in this way:
`Suuugggooo'
S can be a hyphen, meaning a normal file (like here), a `c', indicating a character device file (like your keyboard), a `b', meaning a block device file (like your harddrive), or a `d', meaning a directory.
Then follows is the same `permission' set for user, group and others: --- means no permissions, rwx means read, write and execute permissions, or there might be some missing, eg. rw-, meaning only read/write.
You can control these same permissions from Nautilus, by right clicking the file, choosing `Properties' and selecting the `Permissions' tab. There are also `user ID', `group ID' and `sticky' bits, but those are more advanced concepts. (to do with execute permissions and if you can delete files)
Hope this helps, - Yuki.
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- References:
- Re: file permissions
- From: Ray Canzius
- Re: file permissions
- Prev by Date: Re: file permissions
- Next by Date: Re: Unicode Text on Linux and WindowsXP
- Previous by thread: Re: file permissions
- Next by thread: Re: file permissions
- Index(es):
Relevant Pages
|