If I want to find only first match of command grep
I use this:
find -name "*.jar" | xargs grep -al myText | head -1
And it's work just fine. But it's also show the next message:
xargs: grep: terminated by signal 13
Is it possible to suppress this message (to not show this message)?
Why do you have this error message?
-> Signal 13 means a file is unreadable (bad permissions).
2 solutions:
2>/dev/null
after xargs
commandfind -name "*.jar" | xargs grep -al myText 2>/dev/null | head -1
-readable
(readable by current user) to find
commandfind -name "*.jar" -readable | xargs grep -al myText | head -1
You could display unreadable files with this command:
find \! -readable