📌  相关文章
📜  '> dev null 2>&1' 是什么意思 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:35.102000             🧑  作者: Mango

代码示例1
> is for redirect

/dev/null is a black hole where any data sent, will be discarded

2 is the file descriptor for Standard Error

> is for redirect

& is the symbol for file descriptor (without it, the following 1 would be considered a filename)

1 is the file descriptor for Standard Out

Therefore >/dev/null 2>&1 is redirect the output of your program to /dev/null. Include both the Standard Error and Standard Out.

Much more information is available at The Linux Documentation Project's I/O Redirection page.