Reputation: 4510
I have a command, say find . -size +10
I need to redirect the error like "permission denied" to errorlog.txt
find . -size +10 2>errorlog.txt
And to redirect the normal output to standard log file report.txt
find . -size +10 >report.txt
How to combine these two?
Upvotes: 2
Views: 294
Reputation: 27053
Like this:
command > stdout.log 2> stderr.log
or, to also see the output on screen:
(command | tee stdout.log) 3>&1 1>&2 2>&3 | tee stderr.log
Upvotes: 2