A command has two exits for text: one for the result and one for error messages. On the screen they merge, while > sends only one of them to the file.
A command prints its result to standard output and error messages to standard error. The streams have numbers: output is 1, errors are 2. The terminal shows both streams interleaved, so on the screen you cannot tell them apart.
> is short for 1>: stream 1 goes to the file. Stream 2 is sent to a file with 2>. One command can redirect both streams, each to its own file:
The path /etc/hostname ends up in found.txt, the No such file or directory message in missing.txt, and nothing is left on the screen. find prints the same way: the paths it finds go to stream 1, the access refusals to stream 2.
Separate the list from the refusals
In ~/stream-lab, find all the configs in /etc again. Write the list of paths to conf-list.txt and the error messages to errors.txt.
Goals · 0 of 2
- Write the list of paths to conf-list.txt not done yet
- Collect the error messages in errors.txt not done yet