Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I just want to confirm that -> find . -type d -exec chmod 755 {} \; will chmod all directories current and lower will now be 755. Say directory ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    27

    Want To Confirm Chmod All Directories


    Hello,

    I just want to confirm that -> find . -type d -exec chmod 755 {} \; will chmod all directories current and lower will now be 755.

    Say directory scheme is,

    Home/Dir1/Dir2/Dir3/Dir4/Dir5, and I am in dircectory DIR3. If I run the statement above in Dir3, it should mean all directories DIR3/DIR4/DIR5 are all now 755 and DIR1 and DIR2 stay as before.

    Thanks JR

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    If you just run:
    Code:
    find . -type d
    It will show you everything that will be matched when you actually run the -exec command.

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    27
    Hello,

    Thank you for the reply. But just want to confirm the directories it is going to chmod.

    JR

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    What Cabhan is telling you is that everything returned by find . -type d will have performed on them whatever command you pass with the -exec arg in find . -type d -exec command {} \;

    in short, yes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •