What does “/dev/null” mean at the end of shell commands

后端 未结 5 1691
无人共我
无人共我 2020-12-14 07:12

What is the difference between the following commands?

ssh myhostname \"command1; command2;...commandn;\" 2>/dev/null
ssh myhostname \"command1; command2;         


        
5条回答
  •  猫巷女王i
    2020-12-14 07:44

    1) Pipe everything on standard error to /dev/null (so ignore it and don't display it)

    2) Dev null just points to nowhere, pipe anything to that, and it disappears.

提交回复
热议问题