Wget basics

Wget is a tool for unix systems that allow for the downloading of files and even entire websites from the command line. While wget is capable of a lot bellow is some of the basics that will be used by most people for downloading files.

To download a single file
wget <file url>

While downloading a single file is useful wget also allows you to download multiple files. To do this all that is required is to fill a text file such as downloads.txt with each url.

downloads.txt
url1
url2
url3

And then load this into wget and it will do the rest

wget -i <url text file>

Using the example above

wget -i downloads.txt

In some cases you may need or want to change the name of the file that can be done with the -O argument which changes the output (notice it is an uppercase O)

wget -O <new file name> <download url>
The lower case o produces a log file

wget -o <log file> <download url>

Something that can be very useful especially on unstable internet connections is the ability to resume downloads, but be aware this can only be done if the server you are downloading from supports it.

wget -c <download url>

To run downloads in the background use the -b argument. when doing this log files can be useful for monitoring the progress of the download.

wget -b <download url>

These few commands should get you started using wget but this is only a small amount of what wget can do. You can learn more by using the man command (listed below) or by looking at one of the many resources available on the internet.

man wget

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s