Linux - What is dev null, Devnull is a software device
What is dev null
what do you mean /dev/null in linx operating system?/dev/null - is a software device
At times it might be necessary for you to ignore the output of a command which you execute you executed.
This can be done by adding "> /dev/null 2>&1" at the end of a command.
The above commnad redirects the output and error message to "/dev/null", which means you dosen't care about the output or error message. TO kno more abote this we must understand the file descriptor. The below will give you the idea about file descriptor.
File descriptor - 0 STDIN File descriptor - 1 STDOUT File descriptor - 2 STDERR
Redirect error messages from command to file.
command 2> filename
Append error messages from command to file
command 2>> filename
Redirect output and error messages to file.
command &> filename
Redirect output and error messages to the less cmd
command 2>&1 | lessIn the above command we have redirect STDERR to STDOUT and then forward STDOUT over a pipe. If we simply redirected STDERR to 1, This would redirect to a file called "1" rather than to a file descriptor 1(STDOUT). Prepend the '&' character to the destination number specifies that it is a file descriptor.
The topic on Linux - What is dev null is posted by - Math
Hope you have enjoyed, Linux - What is dev nullThanks for your time