Output redirect

Asked

Viewed 20 times

0

comando | tee -a saida.txt

How do I redirect only part of the output of a command?

1 answer

0


Depending on the output of the executed command you can use grep (or one of its variants, egrep or fgrep). For example:

comando | grep batata | tee -a saida.txt

In the above example, only lines containing the word potato are passed to the tee.

Depending on the filter (if you need something more sophisticated), you can use the awk or sed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.