What does "< /dev/null" mean?

It ensures that all I/O streams are accounted-for/occupied.

This way, the backgrounded process has nothing "tied" to the terminal so you can go about your business without your program trying to read from TTY, which would cause the terminal to hang.

In this case, since you're launching the process over ssh from a shell script, it's making sure that the script can move along unencumbered.


program </dev/null means that the program is taking its input argument (can be input parameter to an option or can be input file to operate on) via file descriptor 0 i.e. STDIN, from the file /dev/null.

As you already know, /dev/null contains nothing, it will notify EOF (End of File) upon read so any program taking input from /dev/null will basically redirecting nothing as its input argument.

Tags:

Bash