Jump to content

Understanding Chmod

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Guest_C3P0_*

Guest_C3P0_*
  • Guests
I'm working on my server and I can't figure out what permissions are for and how to use them. First I see some people use this:

chmod r+w <filename>

and others

chmod 755 <filename>

Why two different ways and what does each do? How does r+w convert into numbers???

When I do a ls -la I see this:

-rwxrwxrwx <filename>

what does that mean? I could see just a rwx which would be read, write, execute but what are the other two rwx for????

#2
Grub

Grub

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts
r = Read Permission
w = Write Permission
x = Execute Permission

+ = add Permission
- = subtract permission
= = set permission equal

thus chmod r+w <filename> means read add write <filename>

The numbers are calulated by adding the amount together:

Read: 4
Write: 2
Execute: 1

So for everyone to read/write/execute you have chmod 777.

The first "-" means directory or file. Will have a "d" if directory.

The first group of "---" are owner. T
he second group is group.
The third group is other.

#3
Prog

Prog

    Learning Programmer

  • Members
  • PipPipPip
  • 98 posts
chmod is a little hard to understand at first but once you get the grasp of it you can understand it easier.