On 2020-11-25, Manuel Giraud <[email protected]> wrote:
> I have one (somewhat) related question left: is possible to capture the
> output of pkg_delete -an in a file? I tried the following (without
> luck):
> $ pkg_delete -an > /tmp/foo
Here you redirect stdout from the process to /tmp/foo
> $ pkg_delete -an > /tmp/foo 2>&1
And here you redirect stdout from the process to /tmp/foo, and then
stderr to stdout.
What you need is:
$ pkg_delete -an 2>&1 > /tmp/foo
- redirect stderr to stdout, then redirect stdout (which now includes
stderr) to /tmp/foo.