CHMOD Question

Discussion in 'all things UNIX' started by wat0114, Mar 17, 2011.

Thread Status:
Not open for further replies.
  1. wat0114

    wat0114 Guest

    So I have a question about CHMOD with regards to a directory which I hope some kindly person can address :) In the example below of my home directory, the permissions imply: read, write, execute for the owner, read and write only for the group and also read and write for others. However, a directory of course can not be executed, and somewhere I read that the x in the case of directory permissions only means it is searchable. This makes sense so I just wanted to confirm it, or does it mean that any executable type files within the directory can be executed by the owner? It's a bit confusing to me because the syntax appears to be as I stated above, or in numerical form as: 755. It also looks like owner and group are the same - root?

    drwxr-xr-x 4 root root 4096 Mar 12 00:51 home
     
    Last edited by a moderator: Mar 17, 2011
  2. chronomatic

    chronomatic Registered Member

    Joined:
    Apr 9, 2009
    Posts:
    1,343
    The "x" bit on a directory means that one can search through the directory and execute any files within it. In this case, no one but root can modify the directory. Everyone else can only execute/search through it (not modify it).
     
  3. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,695
    The x bit on directories means you can execute directory commands, like listing contents and such, it does not automatically mean files inside are executable.
    Mrk
     
  4. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,677
    Location:
    George, S.Africa
    BTW, wat0114, best tutorial I have seen regarding chmod. Take a look here
     
  5. wat0114

    wat0114 Guest

  6. tlu

    tlu Guest

  7. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,677
    Location:
    George, S.Africa
  8. wat0114

    wat0114 Guest

    Actually, just caught my erroro_O It should state: read and execute for the group and others permissions :oops:
     
  9. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,677
    Location:
    George, S.Africa
    Holy moly, tlu missed that one. ;)
     
  10. wat0114

    wat0114 Guest

    Ha-ha, it looks like everyone else did too :D :p
     
  11. tlu

    tlu Guest

    Shame on me :D:D:D
     
  12. ard14n_y

    ard14n_y Registered Member

    Joined:
    Dec 30, 2009
    Posts:
    25
    r bit on directories means you can execute 'ls' command
    x bit on directories means you can execute 'cd' command

    dr-------- 2 tux tux 4096 Mar 23 13:19 d1
    d--x------ 2 tux tux 4096 Mar 23 13:22 d2

    cd d1
    bash: cd: d1: Permission denied

    ls d2
    ls: cannot open directory d2: Permission denied
     
  13. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    one more easy way to do things is that

    midnight commander (MC)

    i almost do every thing from mc chown chmod .......etc great tool :D

    also another easy one

    gnome commander
     
Thread Status:
Not open for further replies.