

$ wget -output-document=file=file.tzx ' # OR use the capital '-O' as follows # Say you are downloading and you just wanted to save it as file.tzx, then: The -O FILE or -output-document=FILE is used to tell wget to download given file from URL and save into name stated by this option.
#Wget examples how to
Type the following command to grab the latest Linux kernel and compile and install the Linux Kernel from source code:įig.01: wget command in action on my Linux box How to save the downloaded file under a different name and directory using the wget Downloading a single file using the wget command Let us gets some hands-on experience to increase our productivity. Now that the GNU wget command is installed on your Linux or Unix-like system, it is time to learn how to use the wget command to download stuff from the LAN, WAN, or Internet.

OpenBSD and NetBSD users try the following pkg_add command to install the wget command: MacOS user first install Homebrew on Mac OS to use the brew package manager and then type the following brew command for installing the GNU wget command: # apk add wget Installing GNU/wget on Unix like systemsįreeBSD users try the pkg command to install the GNU wget command:

SUSE/OpenSUSE Linux user should type the zypper command to install the wget command:Īrch Linux users should type the pacman command when you wish to install the GNU wget command:Īlpine Linux users try the apk command to install the GNU wget command instead of using busybox wget: RHEL/CentOS/Oracle/Rocky and Alma Linux users should type the yum command to install the wget command: Use the apt command/ apt-get command if you are on Ubuntu/Debian/Mint Linux:įedora Linux users should type dnf command Let us see some common Linux wget command examples, syntax and usage. The url where files are located is always the last parameter. The syntax is as follows for wget command in Linux, macOS, and Unix system:
