Silence Result Of Command
When you want to silence the result of a command in a Unix-like shell environment, you can use the > /dev/null or 2> /dev/null redirection techniques, depending on whether you want to suppress standard output (stdout) or standard error (stderr) respectively. Here’s how you can use them:
-
To silence standard output (stdout) of a command, use
> /dev/null:1command > /dev/nullThis will discard the normal output of the command.
-
To silence standard error (stderr) of a command, use
2> /dev/null:1command 2> /dev/nullThis will discard error messages and keep only the standard output.