Timeline for What does 2>&1 in this command mean?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Jul 26, 2018 at 21:06 | history | suggested | Hashim Aziz | CC BY-SA 4.0 | Added the command in text to make more easy to follow |
| Jul 26, 2018 at 17:47 | review | Suggested edits | |||
| S Jul 26, 2018 at 21:06 | |||||
| Nov 7, 2013 at 17:45 | vote | accept | codecowboy | ||
| Nov 7, 2013 at 17:32 | comment | added | Joseph R. | It might also be worth noting that the same semantics are often achieved with the idiom &>/dev/null | |
| Nov 7, 2013 at 17:32 | comment | added | dg99 | Yes, the complete silencing trick is standard practice to make sure that absolutely no output exists to trigger email from a cron job. (Note, however, that the hosting provider may have done all sorts of strange things to your cron environment to make it send some sort of email regardless of your efforts.) ::edit:: And no, spaces around the lone > do not matter, but spaces within the 2>&1 probably do matter (I can't recall). | |
| Nov 7, 2013 at 17:28 | comment | added | codecowboy | Thanks. When run in a shared hosting cron job which typically sends an email of the output to an admin, would the > /dev/null 2>&1 prevent this from happening do you think? Also do spaces surrounding '>' matter? | |
| Nov 7, 2013 at 17:26 | history | answered | dg99 | CC BY-SA 3.0 |