Search code examples
bashsh

How do I interpret this bash output redirection with '<'?


I have this Bash command {java command} > /dev/null 2>/var/log/server.log < /dev/null & and I'm having a hard time understanding what this means.

I know that...

  1. > /dev/null means to stdout to a void
  2. 2>/var/log/server.log sends errors to /var/log/server.log
  3. & means to run in the background

But what is < /dev/null? Also, am I understand the redirection correctly?


Solution

  • < means redirection of stdin, i.e, standard input.

    < /dev/null means input source has nothing, and stdin is always EOF.