Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to use wget to save the text of a web page. I run:

wget "http://www.finance.yahoo.com/q/op?s=GOOG" > goog.txt 

to try and save the web page to goog.txt, but instead wget tells me:

Saving to: `op?s=GOOG'

Why is wget acting like this, and how can I get the expected behavior?

share|improve this question

migrated from stackoverflow.com Apr 30 '11 at 5:46

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

2 Answers 2

Use the -O option:

wget "http://www.finance.yahoo.com/q/op?s=GOOG" -O goog.txt 
share|improve this answer
1  
And to answer the first part of the question (why): wget prints tracing information to standard output and downloads the content to a file whose name is derived from the URL and server response. Also, use -q to suppress tracing information. –  Gilles Apr 30 '11 at 12:12
curl "http://www.google.com/" >> /Users/name/desktop/temp.txt
share|improve this answer
    
1. The OP is asking about wget, not curl (If you expand on why you recommend curl, this might be fine). 2. One line answers are often not very helpful. Give some modicum of explanation or elaboration to help enrich everyone's experience. –  HalosGhost Jul 10 at 21:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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