find /some/dir -iname *some-substring* 2> /dev/nullWill not display any errors (e.g., inaccessible files or directories) but redirect stderr to ‘nowhere’ (
2> /dev/null
).
2> file.txt
will redirect stderr to a file.
The same is possible for stdout:
> file.txt
will redirect stdout to a file.
To redirect both, use:
&> file.txt
will redirect stdout and stderr to the same file.
To suppress both, use:
&> /dev/null
.