Weblog entry #2 for ashirvani
#2
Redirecting stderr and stdout to less
Posted by ashirvani on Mon 24 Dec 2007 at 17:17
To redirect stderr and stdout to less do:
<your command> 2>&1 | less
I did not any way to only redirect stderr to less? If you know how can
do that please help me.
Thanks.
<your command> 2>&1 | less
I did not any way to only redirect stderr to less? If you know how can
do that please help me.
Thanks.
Comments on this Entry
<yourcommand> 2>&1 1>/dev/null | less
should do what you want.
phil
should do what you want.
phil
[ Parent | Reply to this comment ]
Use '>' better than '1>', isn't it?:
<yourcommand> 2>&1 >/dev/null | less
<yourcommand> 2>&1 >/dev/null | less
[ Parent | Reply to this comment ]
Hmm. Define "better"?
I would think ours are the same except I explicitly define which output is going to dev/null. Am I wrong?
phil
I would think ours are the same except I explicitly define which output is going to dev/null. Am I wrong?
phil
[ Parent | Reply to this comment ]
On manuals and how to, I always see:
echo XXX > YYY
It's shorter than '1>'
But, yes it's is the same exactly the same.
It was a tip (I said better because my english is very bad ;) )
echo XXX > YYY
It's shorter than '1>'
But, yes it's is the same exactly the same.
It was a tip (I said better because my english is very bad ;) )
[ Parent | Reply to this comment ]