On 2023-05-11, red floyd <
[email protected]d> wrote:
On 5/9/2023 8:31 AM, Michael Wood wrote:
sed is acting on stdout, but the errors get written to stderr. You can
re-direct stderr to stdout, to get the sed to work using:
du -d 1 2>&1 | sed '/du:/d'
OP doesn't want the stderr. So the previously discussed
du -d 1 2> /dev/null | sed '/du:/d'
is the proper answer here.
Except all of the lines with du: in them are from stderr, not stdout.
so
du -d 1 2> /dev/null
would be enough. However there might be other lines in stderr that he
wants to see. Certainly his post says he only wanted to get rid of the
lines with du: in them.
--- MBSE BBS v1.0.8.3 (Linux-x86_64)
* Origin: A noiseless patient Spider (2:250/1@fidonet)