</dev/null disconnects the program's input from the terminal. Some programs react differently depending on what their standard input is connected to. With the redirection
</dev/null, the program can tell that its input is not coming from a terminal, and will receive an end-of-file indication immediately if it tries to read from its standard input.
& at the end causes the program to be executed in the background. This means that you get a shell prompt back immediately. Without the
&, you would get a shell prompt back only when the program finishes executing.
Note that the standalone
& is unrelated to
>& is a redirection operator (in tcsh, bash and zsh) which redirects both the program's standard output and the program's standard error to the file name specified after the operator (here
In other words, what the shell does when it sees this command line is:
- Start a process in the background. In the background process:
- Connect standard input to
/dev/null (the null device).
- Connect both standard output and standard error to the file called
log (creating the file if it doesn't exist yet, and truncating it if it exists).
- Look for an executable file called
java in the
- Execute that file with the 5 arguments