3

I'm trying to combine two things.

I have to set permissions on a number of directories, all of which have "domain-" in their name.

I wanted to "find all directories in the current directory that have the string 'domain-' in their names and change the permissions to 755.

I keep getting syntax errors and am so frustrated that I just need to ask!

thanks

4

I would use the find command:

find . -type d -name 'domain-*' -exec chmod 755 {} +
  • . specifies the path to search.
  • -type d makes this only apply to directories.
  • -name ... specifies the name of the directories this should apply to.
  • -exec ... {} + is the command that will be run for each collection of matchs.
  • Thanks Thor, that was exactly what I needed and a nice explanation. – kelly johnson Feb 14 '13 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.