Linux输入输出重定向
&>file 意思是把标准输出 和 标准错误输出 都重定向到文件file中 /dev/null是一个文件,这个文件比较特殊,所有传给它的东西它都丢弃掉 command > filename 把标准输出重定向到一个新文件中 command » filename 把标准输出重定向到一个文件中(追加) command 1 > fielname 把标准输出重定向到一个文件中(和 > 一样的) command > filename 2>&1 把标准输出和标准错误一起重定向到一个文件中 command 2 > filename 把标准错误重定向到一个文件中 command 2 » filename 把标准输出重定向到一个文件中(追加) command » filename 2>&1 把标准输出和标准错误一起重定向到一个文件中(追加) command < filename >filename2 把command命令以filename文件作为标准输入,以filename2文件作为标准输出 command < filename 把command命令以filename文件作为标准输入 command « delimiter 把从标准输入中读入,直至遇到delimiter分界符 command <&m 把文件描述符m作为标准输入 command >&m 把标准输出重定向到文件描述符m中 command <&- 把关闭标准输入 原文链接