Search only directories with permission -find (Bash 4.2)
06:59 24 Feb 2015

I have a command on AIX that finds files containing a phrase and are older than a certain age. however my report is full of permission denied errors. I would like the find to only search files that it has permission for.

I have command for linux that works

find /home/ ! -readable -prune -name 'core.20*' -mtime +7 -print

however in this case i am unable to use readable.

find /home/ -name 'core.20*' -mtime +7 -print 2>/dev/null

works rather well, but this still tries to search the directories costing time.

bash find aix