I have a program that writes messages to stderr using write() to file
descriptor 2. I want to pipe that to ‘less’. Shouldn’t
program 2| less
work? It doesn’t. I can do
program 2>&1 | less
but I really don’t want to see the standard output on the less screen.
What is the proper syntax to pipe stderr only to another program?
New question:
I’m running a program that continually generates output. I’m pipeing
that program to less. Sometimes it generates many lines and I just want
to see what’s coming out NOW. I.E. I want to jump to the end of the pipe
as it exists right now. The pipe may now be very large. My understanding
is that if I type
'&
in less it should jump to the end of the pipe. But it never seems to
finish. I don’t think the first program is generating data faster then
less can read it while NOT displaying it.
How can I jump to the end of the pipe as of right now while the pipe is
still being filled with data?
Added explanation:
In case your interested, the program in question monitors network traffic.
It is normally run to see good status information. That prints out on
stdout.
The program also prints out error messages when it spots a network error.
Sometimes the network error are cronic. They don’t stop. So as I’m
fiddeling with other things on the network I want to look and see if its
working now. I don’t care about all of the messages that printed in the
last 15 minutes. I want to see what, if any, error messages are coming
out now. BUT, based on what I see now, I may want to scroll back a minute
or two.
TIA