Home arrow Journal arrow Redirect stdout and stderr to dev null
Redirect stdout and stderr to dev null PDF
Saturday, 11 February 2012
If we want to redirect stout and stderr output of a FreeBSD command we end the command line with the following code: >/dev/null 2>&1 like in next example:

  script.sh >/dev/null 2>&1
or
  script.sh param1 param2 >/dev/null 2>&1

Our script script.sh output will be redirected to /dev/null.
param1 and param2 are some parameters of the script.sh (if it has any...).

 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?