Redirection and pipes
We can redirect stderr to stdout like this:
ls -l doesnotexist >& outputfile
ls -l doesnotexist >>& outputfile (to append)
Redirect stderr and stdout to a pipe:
find . -name "doesnotexist" -print |& grep -v "denied"
Redirect both stderr and stdout to both stdout and a file:
find . -name "doesnotexist" |& tee outputfile
0 Comments:
Post a Comment
<< Home