Redirecting output to multiple locations?
How does one redirect the output for a command to multiple locations? For instance for:
Code:
ls /dir > out1.txt And can one both output to an output file, and display the output to the shell screen as normal (as if there was no output redirection)? |
you can use
Code:
ls /dir > a ; cat a > b but it works |
Quote:
|
And if you don't want to see it use tee and redirect ;}
Code:
$ls /dir | tee out1.txt > out2.txt |
Nice solution
Tinkster and grizly didnt think about it... |
Or simply
Code:
ls /dir | tee file1 file2 file3 file4 file5 ... fileN > /dev/null |
Quote:
The program that I actually want to output takes a very long time (hours), so the two commands option wouldn't work, but 'tee' does. |
All times are GMT -5. The time now is 06:09 PM. |