LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Saving a file from a known URL (https://www.linuxquestions.org/questions/linux-software-2/saving-a-file-from-a-known-url-596265/)

basha_msc 11-01-2007 04:13 AM

Saving a file from a known URL
 
How to save a file from a known URL to my shell window when i don't have GUI

veerain 11-01-2007 04:47 AM

use wget or curl
 
wget url
or
curl -o filename url

http://www.spreadfirefox.com/?q=affi...211983&t=1

dansmith127 11-01-2007 06:49 AM

Filename
 
wget url

saves the output to whatever original file is called, for example:

wget http://google.com/index.html

saves the output as index.html. To specify a different filename:

wget -O YourFileNameChoice.html http://www.google.com/index.html

basha_msc 11-02-2007 12:30 AM

I want to know the command to store the file from a known URL to my shell window

dansmith127 11-02-2007 06:14 AM

Quote:

I want to know the command to store the file from a known URL to my shell window
That doesn't really make sense. The standard output of wget is not the file, but rather the info about what it's doing ('Downloading file... 4 bytes... etc').

wget always 'stores' (saves) the file to your current directory, whether you want it to or not.

If you want to suppress the standard output, and have a command which will download a file and then print the files contents to your terminal screen, try this:

wget -q -O yourfilename.html http://www.somesite/somepage.html && less yourfilename.html

This will download the file without giving any standard output (-q means 'quiet' mode), save it to your current working directory with whatever filename you specify after the -O flag, then open up that same file for viewing using 'less'. You could also use 'more' or your favourite text editor, eg 'vim', 'emacs', in place of 'less'.


All times are GMT -5. The time now is 05:29 AM.