views:

14

answers:

3

I need to see all files (with full pathname), along with their file permissions, on a folder which DO NOT match

-rw-r--r--

This didn't work as I thought it should have:

#ls -laR | grep --invert-match '-rw-r--r--'
grep: invalid option -- -
A: 

You need to backquote all -:

#ls -laR | grep --invert-match '\-rw\-r\-\-r\-\-'
Benoit Thiery
Or you can just put `--` before the pattern.
Ignacio Vazquez-Abrams
Hi - this actually gave me the right output... the others were showing the opposite of what was needed...
matt_tm
A: 
find . -maxdepth 1 \! -perm 0664 -printf '%M\t%P\n'

Modify format string as desired.

Ignacio Vazquez-Abrams
A: 
ls -laR | grep -- "-rw-r--r--"

but you really should use GNU find.

ghostdog74