I’m trying to answer this lab question. Is there a way to solve this without using
As user1 on server1, run the
ls command on
/var. Have the output printed on the screen as well as redirected to file
/tmp/ioutput, and the errors forwarded to file
/tmp/ioerror. Check both files after the execution of the command and analyze the results. (Hint: Input, Output, and Error Redirections).
If I tried like this, the output is not printed on the screen.
[user1@server1 ~]$ ls /etc /dvd /var 1> /tmp/ioutput 2> /tmp/ioerror
If I used with
tee command, error file was empty.
ls /etc /dvd /var | tee /tmp/ioutput 2> /tmp/ioerror
Is there a way to solve it only by using redirection operators?