Home > database >  What does 2>&1 (usually after 1>/dev/null) variable in shell scripting do?
What does 2>&1 (usually after 1>/dev/null) variable in shell scripting do?

Time:10-15

I'm currently learning shell scripting, and I am trying to understand a source code i got from GitHub that contains the line:

mountpoint /mnt/share 1>/dev/null 2>&1

What is the 2>&1 variable hold? What is its purpose?

I tried Google Search but they block punctuation...

Can someone give me some directions? Thank you.

CodePudding user response:

2>&1 redirects the standard error to the standard output
Official documentation:https://tldp.org/LDP/abs/html/io-redirection.html

  • Related