Some output is noise. /dev/null is a special file that throws away everything that you write to it. Send the noise there.
text
learner@tidepool:~$ grep -r prices-01 /etc
grep: /etc/secret.conf: Permission denied
/etc/shop/till.conf:prices=prices-01
learner@tidepool:~$ grep -r prices-01 /etc 2> /dev/null
/etc/shop/till.conf:prices=prices-01grep -r prices-01 /etc
2: stderr
/dev/nullthrown away
Throw away either stream
| Line | Throws away |
|---|---|
cmd 2> /dev/null | The errors |
cmd > /dev/null | The output |
cmd > /dev/null 2>&1 | Both |
/dev/null is always empty. Writing to it never makes it bigger.