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'
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.
On 2023-05-11, red floyd <no.spam.here@its.invalid> 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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 483 |
Nodes: | 16 (2 / 14) |
Uptime: | 90:41:59 |
Calls: | 9,579 |
Calls today: | 1 |
Files: | 13,667 |
Messages: | 6,143,842 |