Wednesday, June 2, 2010

Exclude Directories in Bash Find | practical web development & design. cincinnati, oh

Exclude Directories in Bash Find | practical web development & design. cincinnati, oh

Just a quick blurb to thank tcmacdonald's blog for the help with this bash find command snippet:

find . -type f -not -path "*svn*" -exec chmod 644 '{}' \;


To be specific, I'm using `find` in a for loop to get all directories but I didn't want the results for the root directory (./).

So my snippet now looks like:

for f in `find . -maxdepth 1 -not -path '.' -type d`; do
...


And now I don't see the results for ./ listed! Thank you! Cheers!

No comments: