/dev/null 2>&1

#/bin/bash

echo "this is standard output"

[vagrant@localhost app]$ ./echo.sh
-bash: ./echo.sh: /bin/sh^M: bad interpreter: そのようなファイルやディレクトリはありません
[vagrant@localhost app]$ sed -i ‘s/\r//’ echo.sh
[vagrant@localhost app]$ ./echo.sh
this is standard output

It took an hour to come here.

If it is executed normally, it will be displayed on the standard output, but if you redirect it, it will be able to output to another location.

When redirecting to standard error output
[vagrant@localhost app]$ ./echo.sh >&2
this is standard output

When redirecting to standard output
[vagrant@localhost app]$ ./echo.sh >&1
this is standard output

[vagrant@localhost app]$ ./echo.sh > /dev/null
/dev/null is a unix special file, it is an empty file.

Merging standard error output to standard output
2>&1

somehow I got it.