Raspberry Pi

How to Download Files on Raspberry Pi Through Terminal

If you are a Raspberry Pi user, you will always feel the need to download files from the terminal. The reason is using the Chromium Browser to download files is a straightforward task but it consumes a lot of system resources. Further, if you are using the lite version of Raspberry Pi OS, you will certainly want a way to download files directly from the terminal.

Head towards the article’s guidelines to learn different ways to download files on Raspberry Pi through terminal.

How to Download Files on Raspberry Pi Through Terminal

There are three different ways to download files on Raspberry Pi through terminal, which are as follow:

1: Download Files on Raspberry Pi through wget

The wget command is probably the most popular way to download files on a Raspberry Pi. It is because this command is already installed on the Raspberry Pi Bullseye version and people mostly use this command to download files on the Raspberry Pi system. The basic syntax of the command looks like this:

$ wget <copy-the-files-web-address>

Here I am showing you an example to download a file using the wget command.

2: Download Files on Raspberry Pi through cURL

The cURL or curl command is another useful way to download files on a Raspberry Pi. This command works like the wget command, but its syntax is little different than it.

$ curl <copy-the-files-web-address>

In the above command, you must specify the address of the file you want to download with the output file name to be saved on your Raspberry Pi system.

Here I have downloaded a pdf file and saved this file with the name “myfile.pdf” through curl command.

You can also specify the file name using the below mentioned syntax:

$ curl <copy-the-files-web-address> --output <output-filename>

3: Download Files on Raspberry Pi through HTTPie

The HTTPie command is a newer one that is gaining popularity when compared with the wget and curl commands. It is more intuitive than the other two commands as it allows you to send HTTP requests more easily from the command line. You must install HTTPie on Raspberry Pi from the following command before downloading files through it:

$ sudo apt install httpie

The syntax of this command looks like this:

$ http <copy-the-files-web-address>

This may be used as an example to download files using HTTPie on your Raspberry Pi system.

$ http --download https://github.com/httpie/httpie/archive/master.tar.gz

Conclusion

Downloading files from Raspberry Pi terminal is an easy task and it can be done through wget, curl and HTTPie commands. Both wget and curl are already installed on the Raspberry Pi system. While for HTTPie, you must install it from the Raspberry Pi source repository. The syntax to use these commands are already shown in the above guidelines. It doesn’t matter which command you choose; you’ll be able to quickly download files on your Raspberry Pi system.

About the author

Hiba Shafqat

I am a Computer Science student and a committed technical writer by choice. It is a great pleasure to share my knowledge with the world in which I have academic expertise.