• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

wget Command Examples in Linux

by admin

The wget command is one of the most popular non-interactive command-line file downloaders in Linux. It can download multiple files/directories and can work in the background as well. The downloaded web page can be opened with any graphical or non-graphical browser.

Some of its popular features are as follows:

  • Support of HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies
  • Resume partial downloads
  • Large file downloads
  • Recursive downloads for mirroring a website
  • Password-required downloads

Syntax:

$ wget [url]

To install Wget on Debian and Ubuntu-based systems, run the following command. There is a significant chance that it’s already installed thanks to its popularity:

# apt-get install wget

To install Wget on Red Hat derivatives use the following command:

# yum install wget

wget Command Examples

1. To download a page:

# wget www.linux.com

2. To log messages:

# wget -o log www.thegeekdiary.com

3. To append to log file:

# wget -a log www.thegeekdiary.com

4. To run in background:

# wget -b  -o log www.thegeekdiary.com

5. To run in verbose mode:

# wget -v -o log www.thegeekdiary.com

6. To run in quite mode:

# wget -q -o log www.thegeekdiary.com

7. To read URLs from file:

# wget -i urlfile -o log www.thegeekdiary.com

8. To set number of tries:

# wget -t 5 -o log www.thegeekdiary.com

9. To see the progress:

# wget --progress=type -o log www.thegeekdiary.com type=bar
# wget --progress=type -o log www.thegeekdiary.com type=dot

10. To turn on time stamping:

# wget -N -o log www.thegeekdiary.com

11. To print the headers sent by the HTTP server/FTP server:

# wget -S -o log www.thegeekdiary.com

12. To check the pages are there or they are available:

# wget --spider -i urlfile

13. To set the time-out period:

# wget -T 60 -o log www.thegeekdiary.com

14. To limit the download speed:

# wget --limit-rate 100K -o log www.thegeekdiary.com

15. To specify the interval between downloads:

# wget -w 10 -o log -i urlfile

16. To display the version of wget:

# wget -V
# wget --version

Final Thoughts

You may find it useful to download a copy of a website for local examination and to use it to run other tests on. If this is something you wish to do, the easiest and simplest way is to use the wget command, which is a standard Linux tool used to retrieve information from websites. The wget utility is a non-interactive downloader.

Filed Under: Linux

Some more articles you might also be interested in …

  1. Using iostat to monitor system performance in Linux (Examples included)
  2. efibootmgr Command Examples in Linux
  3. apport-bug: command not found
  4. mke2fs Command Examples in Linux
  5. How to Determine Which Process is Writing to Disk in Linux
  6. i3 Command Examples in Linux
  7. apache2ctl: command not found
  8. EFS Mount Issue “Failed to resolve server: Name or service not known”
  9. lspci: command not found
  10. Sample /etc/services file in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright