A slightly more reliable pattern (i.e. slightly less risk of skipping the wrong lines by accident) could be
| grep -v "= -1 ENOENT [(]No such file or directory[)]$"
I.e. copy-paste the end of line, "escaping" the brackets (which might otherwise be treated as special characters), and add the special character $
to the end which "anchors" the pattern to the end of the line.
I can't find any better option in man strace
. Quick and dirty text manipulation hacks are the Unix Way :-P.
It's almost certainly possible to do what you want with a custom gdb
script. However that's more work, and I don't have such a script prepared.
Another question references a tracefile
script, which you would run with the -e
option. This is still implemented by parsing the output of strace
, and so it does not appear to be entirely reliable either, but I guess it's possible you'd prefer it. https://gitlab.com/ole.tange/tangetools/blob/master/tracefile/tracefile