Downloading a file from the shell using a URL

Expertise level: Easy

If you have to download a file from the shell using a URL, follow these steps:

  • Login with SSH as root.
  • Navigate to the directory where you want to download the file using cd command:
cd /path/to/directory/
  • Type the following command:

(For example, the file to be downloaded is at


The file.txt file will then be on the server into the directory: /path/to/directory/

If you wish to download a file and save it with a different name, you can use the -O flag:

wget -O /path/to/place/file/file2.txt

In this example, file.txt will be copied to file2.txt.

For more information, please consult the official documentation:


Article is closed for comments.
Powered by Zendesk