我经常在网上看到用不同符号连接各种命令的教程。例如:
command1 | command2
command1 & command2
command1 || command2
command1 && command2
Run Code Online (Sandbox Code Playgroud)
其他人似乎将命令连接到文件:
command1 > file1
command1 >> file1
Run Code Online (Sandbox Code Playgroud)
这些是什么?他们叫什么?他们在做什么?还有更多吗?
我理解> /dev/null
将事物重定向到/dev/null
像黑洞一样的东西。但是,我不明白是什么< /dev/null
意思。我看到一些脚本是这样写的:
nohup myprogram > foo.out 2> foo.err < /dev/null &
Run Code Online (Sandbox Code Playgroud)
那么,< /dev/null
上面的代码是什么意思呢?
这是一个建议的示例