Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!


share|improve this question
up vote 2 down vote accepted

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 match.
share|improve this answer
Thanks Thor, that was exactly what I needed and a nice explanation. – kelly johnson Feb 14 '13 at 23:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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