Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/dev/null 2>&1 ? can somebody explain?

Status
Not open for further replies.

62579183

IS-IT--Management
Nov 29, 2001
2
CA
this is a cron job,

1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1

i understand the first part, but what does this mean
"> /dev/null 2>$1" need you explain, thanks
 
> /dev/null
means "send output of this command to /dev/null" - i.e. discard it.

2>$1
means "send error messages to the same place as normal output" - i.e. discard it.
One by one, the penguins steal my sanity.
 
Just to add to that, if you look at the man page for sh, and read the section on Input/Output Redirection, all will be revealed.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top