What is the command required to redirect the standard error descriptor to a file called error.txt in unix?
I have this command so far:
find / -name "report*" ________ error.txt
You can use the stderr handler 2 like this:
2
find / -name "report*" 2>error.txt
See an example:
$ ls a1 a2 ls: cannot access a2: No such file or directory <--- this is stderr a1 <--- this is stdin $ ls a1 a2 2>error.txt a1 $ cat error.txt ls: cannot access a2: No such file or directory <--- just stderr was stored
As read in BASH Shell: How To Redirect stderr To stdout ( redirect stderr to a File ), these are the handlers:
2.1m questions
2.1m answers
60 comments
57.0k users