wget Command in Linux

Learn via video courses
Topics Covered

Build an AI-First Career, Master the Complete Skillset

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program
NSDC Certified

AI Forward Deployed Engineer Program

Full-stack engineering, production AI and client-facing consulting

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program

Overview

The wget command is a powerful and versatile command-line utility for downloading files from the internet. It supports multiple protocols such as HTTP, HTTPS, and FTP. In this article, we will cover the syntax, options, and examples of the wget command.

Linux wget Command Syntax

The syntax for the wget command is as follows:

Where:

  • options: Optional flags that alter the behavior of the wget command.
  • URL: The URL of the file to be downloaded.

wget Command Options:

  • -O: Specifies the output file name.
  • -c: Resumes an interrupted download.
  • -r: Downloads files recursively from directories.
  • -np: Do not ascend to the parent directory when retrieving recursively.
Sharpen Your Fundamentals with Free Learning

Example Usages

  • Downloading a single file:

    Explanation: Downloads the 'file.txt' from the specified URL.

  • Resuming an interrupted download:

    Explanation: Resumes downloading the 'file.txt' from the specified URL if the download was interrupted.

How Scaler Transformed Careers in Different Fields

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Tips

  • Use '-nc' to skip downloading a file if it already exists in the local directory.

  • To limit the download speed, use the '--limit-rate' option followed by the desired speed (e.g., '--limit-rate=100k').

Advanced Use Cases of wget Command in Linux

  • Downloading a file and specifying the output file name:

    Explanation: Downloads the 'file.txt' from the specified URL and saves it as 'newfile.txt'.

  • Downloading files recursively:

    Explanation: Recursively downloads all files from the specified directory without ascending to the parent directory.

  • Downloading files with a specific file extension:

    Explanation: Recursively downloads all PDF files from the specified directory.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Conclusion

  • The wget command is a powerful command-line utility for downloading files from the internet.

  • wget supports multiple protocols, including HTTP, HTTPS, and FTP.

  • Advanced usages include specifying output file names, downloading files recursively, and downloading files with specific extensions.