跳转到内容
新建笔记

Shell 重定向

终端窗口
# 将stderr重定向到 file
$ command 2 > file
# 将stdin重定向到file
$ command < file
# 将stdout重定向到file
$ command > file
# 将stdout stderr都重定向到file
$ command > file 2>&1
# 将stdin重定向到file1 stdout重定向到file2
$ command < file1 > file2