Linux

Bash redirection

Theory and quick reference There are 3 file descriptors, stdin, stdout and stderr (std=standard). Basically you can: redirect stdout to a file redirect stderr to a file redirect stdout to a stderr redirect stderr to a stdout redirect stderr and stdout to a file redirect stderr and stdout to stdout redirect stderr and stdout to […]

Read More
Linux

someprog > /dev/null 2>&1

The first part, “> /dev/null” means send standard output to the ‘bit bucket” or in other words, throw it away. The second part, “2>&1” means “redirect standard error (2) to the same place as standard outout (1.)

Read More