Stop Microsoft

Operating Systems => Linux and UNIX => Topic started by: CaptainCool on 26 September 2002, 03:20

Title: File permissions
Post by: CaptainCool on 26 September 2002, 03:20
How do you change the permissions for a file  in a terminal?
Title: File permissions
Post by: smokey on 26 September 2002, 03:58
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.
Title: File permissions
Post by: CaptainCool on 26 September 2002, 04:17
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?
Title: File permissions
Post by: smokey on 26 September 2002, 04:27
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
Title: File permissions
Post by: Master of Reality on 26 September 2002, 04:39
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.
Title: File permissions
Post by: voidmain on 26 September 2002, 05:45
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 ]

Title: File permissions
Post by: Stryker on 26 September 2002, 07:42
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.
Title: File permissions
Post by: sporkme on 26 September 2002, 10:38
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.