Você pode usar find
de -regex
para encontrar arquivos correspondentes a uma expressão regular e usar xargs
to chmod
dos arquivos correspondentes.
$ ls -l
total 320
-rw-r--r-- 1 user user 0 2011-10-01 09:38 baaaaaaat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 baaat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 baat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 bat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 boo
$ find ./ -regextype posix-egrep -regex '.*a{3,5}.*' -print0 | xargs -0 chmod 0777
$ ls -l
total 320
-rwxrwxrwx 1 user user 0 2011-10-01 09:38 baaaaaaat
-rwxrwxrwx 1 user user 0 2011-10-01 09:38 baaat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 baat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 bat
-rw-r--r-- 1 user user 0 2011-10-01 09:38 boo
$