comando | tee -a saida.txt
How do I redirect only part of the output of a command?
comando | tee -a saida.txt
How do I redirect only part of the output of a command?
Depending on the output of the executed command you can use grep (or one of its variants, egrep
or% with%). For example:
comando | grep batata | tee -a saida.txt
In the previous example, only rows that contain the word potato are passed to fgrep
.
Depending on the filter (if you need something more sophisticated), you can use tee
or awk
.