I have a crontab that wgets a PHP page every five minutes (just to run some the PHP code), and I want to send the output to /dev/null. I couldn't find it in the wget manual.

I'm looking for something like:

wget -o stout http://whatever.com/page.php > /dev/null

Anyone know?

link|improve this question
feedback

migrated from stackoverflow.com Aug 10 '11 at 6:09

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 0 down vote accepted

wget -O - http://whatever.com/page.php > /dev/null

or, if you want to redirect standard error output also:

wget -O - http://whatever.com/page.php > /dev/null 2>&1

link|improve this answer
feedback
wget -O /dev/null http://example.com/
link|improve this answer
It works on my mac with wget 1.12. – Simon Aug 9 '11 at 22:29
Could you provide some explanation about what your code does? – Tom Wijsman Nov 5 '11 at 1:14
feedback
wget -qO /dev/null http://whatever.com/page.php
  • -q to make it quiet
  • -O /dev/null to ignore the page contents
link|improve this answer
feedback

You can also try:

wget -q -O - http://whatever.com/page.php > /dev/null 

the -q will make it "quiet"

Or have the file go to some temp html page that you don't mind having. whatever.com/tempFile.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.