Linux Commands - wget (download files from remote systems)

The wget command can be used to download files from remote systems to your local Linux system. To put this another way, wget can transfer a file from a remote system to your local Linux system. In this example, the wget command is used to download file1.txt from the web server.

~]# wget 


In this example, the wget command is used to download file2.txt from the FTP server.

~]# wget



Some downloads can take a while. If a download is taking a while, you can switch to another TTY console so that you can continue to interact with the Terminal. Or, you can use the -b or --background option to run wget in the background.

~]# wget -b 



Wget without any options can produce quite a bit of output. The -q or --quiet option can be used to not display any output when running the wget command.

~]# wget -q 


Username Password

If the target system requires a username and password for the resource being requested, the --user and --password options can be used to provide the username and password.

~]# wget --user=the_username --password=the_password


The --ask-password option can be used to prompt for the password when running the command.

~]# wget --ask-password


Also, the /home/username/.wgetrc file can be created, and the username and password can be stored in the .wgetrc file. If the HTTP and FTP username and password is identical, use this format:



If the HTTP and FTP username and password are different, use this format:




When connecting to a secured system, such as an HTTPS web server or an FTPS server, you may get a prompt like this.

~]# wget

ERROR: cannot verify's certificate, issued by ‘/DC=com/DC=example/CN=example’:
  Unable to locally verify the issuer's authority.
To connect to insecurely, use `--no-check-certificate'.


As the warning suggests, you can use the --no-check-certificate flag if you want to connect.

wget --no-check-certificate


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 6a3f5 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |