Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6390607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:34:05+00:00 2026-05-25T03:34:05+00:00

Often, I find myself needing to make a tree of directories executable for someone,

  • 0

Often, I find myself needing to make a tree of directories executable for someone, ie:

find . -type d -exec chmod ug+x {} \;

But I don’t like the overhead of find, and running a “new” chmod for every dir.

You folks have preferred alternatives? Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:34:06+00:00Added an answer on May 25, 2026 at 3:34 am

    This one should have much less overhead:

    find . -type d -exec chmod ug+x {} +
    

    (Replaced \; by +.) This does the same thing, but calls chmod with many directories at once, which eliminates the overhead of calling chmod multiple times.

    From the manpage:

    -exec command {} +  
    

    This variant of the -exec action runs the specified command on the selected files, but the command line is built by appending each selected file name at the end; the total number of invocations of the command will be much less than the number of matched files. The command line is built in much the same way that xargs builds its command lines. Only one instance of {} is allowed within the command. The command is executed in the starting directory.

    This is quite similar to this:

    find . -type d -print0|xargs -0 chmod ug+x
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often find myself needing reference to an object that is several objects away,
I often find myself writing a property that is evaluated lazily. Something like: if
I often find myself doing quick checks like this: if (!eregi('.php', $fileName)) { $filename
I often find myself writing one off queries to either answer someone's question or
often I find myself suprized about simple things, I'm not sure but I believe
I often find myself using lambdas as some sort of local functions to make
I often find myself needing a quick ( in terms of code ), lightweight
I often find myself with an Option[T] for some type T and wish to
I often find myself needing to write functions to load/save from/to ASCII (or similar)
I find myself often needing to use Integer.TryParse to test if a value is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.