google一下就能找到答案了
2表示标准错误stderr,1表示标准输出stdout,2>&1表示将标准错误输出到标准输出中
相当于dup2(1, 2);
即将描述符2关闭并重定向到描述符1。
Here is one way to remember this construct (altough it is not entirely accurate): at first, 2>1 may look like a good way to redirect stderr to stdout. However, it will actually be interpreted as "redirect stderr to a file named 1". & indicates that what follows is a file descriptor and not a filename. So the construct becomes: 2>&1.
This isn't really a "UNIX shell" thing