-4

Example

go |grep help

Expect

go command output filtered.

Addition

[xxx@localhost]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 33 (Thirty Three)
Release:    33
Codename:   ThirtyThree
[xxx@localhost]$ go version
go version go1.15.6 linux/amd64
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
suiwenfeng
  • 1,865
  • 1
  • 25
  • 32
  • Only the actual output / results of a Unix tool belong to stdout. Progress information, diagnostics and logging belong to stderr. https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html – suiwenfeng Jan 27 '21 at 11:23

1 Answers1

1

This isn't stdout, it's stderr. Try redirecting stdout to stderr:

$ go 2>&1 | grep help
Use "go help <command>" for more information about a command.
Additional help topics:
Use "go help <topic>" for more information about that topic.
Marc
  • 19,394
  • 6
  • 47
  • 51