Operating Systems > Linux and UNIX

File permissions

(1/2) > >>

CaptainCool:
How do you change the permissions for a file  in a terminal?

smokey:

quote:Originally posted by CaptainCool:
How do you change the permissions for a file  in a terminal?
--- End quote ---


What os are you using? In linux/unix it is chmod and in dos/windows it is attrib.

CaptainCool:
I'm usin linux.
So if I wanted to change permissions for a file called "file" would i type chmod file then the user name?

smokey:

quote:Originally posted by CaptainCool:
I'm usin linux.
So if I wanted to change permissions for a file called "file" would i type chmod file then the user name?
--- End quote ---


yes - you type chmod whateverfileyouwant permisions.

replace permisions with the 3 letter number. to find them out I think they are in the manual for chmod so type "man chmod" to find out what permisions you want

Master of Reality:
chmod *** file
you need three numbers the first is set for the owner of the file. The second is for others in the owners group and third is for EVERYONE else
the numbers:
1 = execute
2 = write
4 = read
add the number together to set whatever permsions you want. So read and write is "6". Read/write/execute is "7"

chmod 755 file is what you woul;d normally do to an executable or an unwritable directory (like a web directory).

you can also do chmod +% file
where "%" is either the letter "r", "w", or "x" this will add read, write, or executable to everyone.

Navigation

[0] Message Index

[#] Next page

Go to full version