wget Command in Linux
Transform Your Career
Choose from our industry-leading programs designed for career success
Modern Software and AI Engineering Program
Master full-stack development with AI integration
+1000 moreModern Data Science and ML with specialisation in AI
Advanced data science techniques with AI specialization
+1000 moreAdvanced AIML with Specialisation in Agentic AI
Deep dive into AIML with focus on Agentic systems
+1000 moreDevOps, Cloud & AI Platform Engineering
Build and manage AI-powered cloud infrastructure
+1000 moreAI Engineering Advanced Certification by IIT-Roorkee
Premier AI engineering certification from IIT-Roorkee
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.
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.
Scaler Placement Report and Statistics
Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.
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
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.




