I have a server for Euro Truck Simulator 2 which is called by the following command:

LD_LIBRARY_PATH='$ORIGIN/../../linux64' eurotrucks2_server

When the server is running, sometimes I get these lines in console (and I'd like to hide them):

src/steamnetworkingsockets/clientlib/steamnetworkingsockets_sdr_common.h (564) : m_pServer->m_nReplyTimeoutsSinceLastRecv == 0

But whenever I append a | grep -v "Timeout" or | grep -v "steamnetworkingsockets", the server output is truncated at precisely this line:

Setting breakpad minidump AppID = 227300

I also tried the --line-buffered option for grep without luck and also removing grep and using | tail -f has the same result..

Here's the whole output: https://paste.debian.net/hidden/290d8573/


1 Answer 1


The | only catches the standard output (stdout) stream; these messages are going to the standard error (stderr) stream. Using grep to hide the stderr messages is a XY problem.

Solution to the Y problem

To grep both at the same time you need to forward stderr stream to stdout with 2>&1, e.g.,

eurotrucks2_server 2>&1 | grep -v "Timeout"

Solutions to the X problem

  • Discard stderr output with 2>/dev/null, e.g.,

    eurotrucks2_server 2>/dev/null
  • Forward (append) stderr output to a log file with 2>>/path/to/error.log, e.g.,

    eurotrucks2_server 2>>/var/log/eurotrucks2_server_error.log
  • I'm sorry but it still stops at the same point.
    – roughnecks
    Dec 20, 2022 at 18:11
  • this seems to work: 2> >(grep -v "Timeout"). Still waiting a bit to see if something (which shouldn't) shows up.
    – roughnecks
    Dec 20, 2022 at 19:02
  • yeah, not working still, I see all of the content which should be hidden.
    – roughnecks
    Dec 21, 2022 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .