Stop Microsoft
Operating Systems => Linux and UNIX => Topic started by: CaptainCool on 26 September 2002, 03:20
-
How do you change the permissions for a file in a terminal?
-
quote:
Originally posted by CaptainCool:
How do you change the permissions for a file in a terminal?
What os are you using? In linux/unix it is chmod and in dos/windows it is attrib.
-
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?
-
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?
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
-
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.
-
Use "chown" to change ownership of the file, use "chmod" to change file permissions based on that owner and group. I wrote a few quite long messages about file permissions somewhere around here quite a while back. Might want to search the "Linux/UNIX" forum for them. Otherwise do a "man chmod" and "man chown" to see the local documentation. There are bazillions of web sites with better tutorials/instructions. Just type in "chmod" and "chown" in google and you'll have plenty of info.
[ September 25, 2002: Message edited by: void main ]
-
I prefer chmod (a/g/u)+-(r/w/x) filename
so for executables...
chmod a+rx index.cgi
but that's just me, it will be longer if you want to be really specific on who gets what.
-
its just like ftp
777 lets anyone do anything
chmod 777 filename
chmod 766 filename
and such
there is little to understand, really... jack with it.