HowTo Download From The Command Line Using: "wget"

From NST Wiki
Jump to navigationJump to search

HowTo Continue to Retrieve A Partially-Downloaded File With: "wget"

The "wget" command has a "--continue" option for downloading a file that has not been completely retrieved. This is a handly option to use when dealing with large file sizes (i.e. greater than 500MBs) and the connection has stopped. Restarting the download with the "--continue" option will continue the retrieval process from the last byte that was downloaded.

Command: "wget" Using: "--continue" option.
[root@probe tmp]# wget --continue

HowTo Get The HTTPD Headers

The following commands show how one can view the HTTPD header information returned by a web server and discard the results. The second example demonstrates how to do this when authorization is required by retrieving the information from a NST system:

Command: "wget" Using: "-S" option.
[root@probe ~]# wget -S -O /dev/null
--10:33:34-- => `/dev/null' Connecting to connected. Proxy request sent, awaiting response... unspecified HTTP/1.0 200 OK Cache-Control: private Content-Type: text/html; charset=ISO-8859-1 Set-Cookie: PREF=ID=55021cbfbbbc458f:TM=1187879619:LM=1187879619:S=W716ANJU_0IJDXSG; expires=Sat, 22-Aug-2009 14:33:39 GMT; path=/; Server: GWS/2.1 Date: Thu, 23 Aug 2007 14:33:39 GMT X-Cache: MISS from probe.localdomain Proxy-Connection: close Length: unspecified [text/html] [ <=> ] 5,143 --.--K/s 10:33:39 (1.02 MB/s) - `/dev/null' saved [5143]
[root@probe ~]# wget -S -O /dev/null --no-check-certificate --user root \
--password NST_PASSWORD
--10:38:15-- => `/dev/null' Connecting to connected. WARNING: Certificate verification error for self signed certificate WARNING: certificate common name `' doesn't match requested host name `'. HTTP request sent, awaiting response... HTTP/1.1 200 OK Date: Thu, 23 Aug 2007 14:38:08 GMT Server: Apache Expires: Thu, 23 Aug 2007 14:38:08 +0000 Cache-Control: no-cache, must-revalidate Pragma: no-cache Last-Modified: Thu, 23 Aug 2007 14:38:08 GMT Connection: close Content-Type: text/plain; charset=ISO-8859-1 Length: unspecified [text/plain] [ <=> ] 2 --.--K/s 10:38:15 (63.00 KB/s) - `/dev/null' saved [2]
[root@probe ~]#