What does 2>&1 | tee mean?
The tee command prints the piped stdout to the file path given as well as displaying it in the terminal. This is commonly used for recording the output of commands to file which would otherwise only be ephemerally printed to the terminal.

Without tee and using simple redirection of brew install &gt; install.log would prevent stdout being printed to the terminal as well as the file, requiring the file to be accessed to view the messages.
2&gt;&amp;1 redirects stderr to stdout alongside the existing stdout, meaning that the error messages are redirected as normal output.

Without this, tee would only print stdout without the error messages to the install log.


install.log is relative to the current directory.