CHMOD files in subdirectories

Discussion in 'Site & Server Administration' started by SamOwen, Sep 16, 2008.

  1. #1
    What command do I use if I want to change the permissions on all files in sub-directories, but not the sub-directories themselves?

    Example:
    maindir
    - subdir1

    -- file1
    -- file2
    -- file3

    - subdir2
    -- file1
    -- file2
    -- file3

    - subdir3
    -- file1
    -- file2
    -- file3


    I want to change only the permissions on the files in the sub-directories.

    I tried chmod -R 644 *.* , it didn't work.
     
    SamOwen, Sep 16, 2008 IP
  2. nimhost

    nimhost Active Member

    Messages:
    235
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    ^

    chmod -R will change all files and directory :)
     
    nimhost, Sep 17, 2008 IP
  3. oc-scott

    oc-scott Active Member

    Messages:
    420
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    68
    #3
    Try chmod -R 644 MainDirectoryname
     
    oc-scott, Sep 17, 2008 IP
  4. SamOwen

    SamOwen Peon

    Messages:
    865
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Someone showed me the answer here.
     
    SamOwen, Sep 17, 2008 IP
  5. Messengerss

    Messengerss Banned

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for your compliment. I make sure the person-in-charge gets your message.
     
    Messengerss, Sep 18, 2008 IP