Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Ways to make only dirs executable WITOUT using find

    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?

  2. #2
    have u tried chmod -R?

  3. #3
    chmod -R will make ALL files executable, I only want the x bit set in directories.
    chmod -RX . is a better, but only if none of the regular files have any of thier x bits set. The best I have found is:
    find . -type d -exec chmod ug+x {} +
    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.

  4. $spacer_open
  5. #4
    what about just calling one chmod on the output of the find command? e.g.:
    chmod +x `find . -type d whatever`
    does that do what u want? I've never used the '+' with find before...

Posting Permissions

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