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

后端 未结 5 1684
无人共我
无人共我 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条回答
  •  再見小時候
    2020-12-14 07:30

    2> means "redirect standard-error" to the given file.

    /dev/null is the null file. Anything written to it is discarded.

    Together they mean "throw away any error messages".

提交回复
热议问题