Display probe standard output on the terminal.
Discard permission and other standard-error messages without displaying or saving them.
Which form is appropriate?
2>/dev/null sends only file descriptor 2 to the null device while leaving standard output unchanged.
Detailed explanation
probe 2> /dev/nullCorrect. stderr is discarded and stdout still reaches the terminal.
probe > /dev/nullIncorrect. This discards stdout and leaves stderr visible.
probe > /dev/null 2>&1Incorrect. Both stdout and stderr are discarded.
probe < /dev/nullIncorrect. This changes standard input, not the destination of stderr.
Try it yourself
An example you can run in a temporary verification environment.
sh -c 'echo visible; echo hidden >&2' 2>/dev/nullExpected result
visibleKey points
- /dev/null is a discard sink
- 2> targets stderr
- stdout remains connected
Notes
- Environment: Linux / POSIX shell / /dev/null
- Use temporary files and harmless commands for stream experiments.
- Shell redirection syntax and xargs behavior should be checked on the target shell implementation.
Foundation review
Place the operation
Redirecting descriptor 2 leaves ordinary output visible while suppressing diagnostics.
Check the side effect
Run a command that emits both streams and confirm that only ordinary output remains.