开发者

List all files in all subdirectories NOT having specified file permissions

开发者 https://www.devze.com 2023-01-21 16:31 出处:网络
I need to see all files (with full pathname), along with their file permissions, on a folder which DO NOT match

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:

#开发者_StackOverflowls -laR | grep --invert-match '-rw-r--r--'
grep: invalid option -- -


You need to backquote all -:

#ls -laR | grep --invert-match '\-rw\-r\-\-r\-\-'


find . -maxdepth 1 \! -perm 0664 -printf '%M\t%P\n'

Modify format string as desired.


ls -laR | grep -- "-rw-r--r--"

but you really should use GNU find.

0

精彩评论

暂无评论...
验证码 换一张
取 消