• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 10, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

How to Download Files to Specific Directory Using Wget

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
301
VIEWS
Share on FacebookShare on Twitter

Wget is a popular, non-interactive and widely used network downloader which supports protocols such as HTTP, HTTPS, and FTP, and retrieval via HTTP proxies. By default, wget downloads files in the current working directory where it is run.

Read Also: How to Rename File While Downloading with Wget in Linux

In this article, we will show how to download files to a specific directory without moving into that directory. This guide is useful, if, for example, you are using wget in a script, and want to automate downloads which should be stored in different directories.

In addition, wget being non-interactive (can work in the background) by design makes it easy to use for automating downloads via shell scripts. You can actually initiate a download and disconnect from the system, letting wget complete the job.

Wget’s -P or --directory-prefix option is used to set the directory prefix where all retrieved files and subdirectories will be saved to.

In this example, we will demonstrate how to download the glances config template and store it under /etc/glances/ directory.

$ sudo mkdir /etc/glances
$ ls /etc/glances/
$ sudo wget https://raw.githubusercontent.com/nicolargo/glances/develop/conf/glances.conf -P /etc/glances/
$ ls /etc/glances/
How to Download Files to Specific Directory Using Wget

Wget Download Files to Specific Directory

If you are downloading a heavy file, you may want to add the -c or --continue flag, which means continue getting a partially-downloaded file. With it, you don’t have to start the download afresh.

This option helps you to resume downloading a file started by a previous instance of wget, or by another program or one that you had paused. It is also useful in case of any network failure. For example,

$ wget -c https://tenet.dl.sourceforge.net/project/parrotsecurity/iso/4.1/Parrot-security-4.1_amd64.iso

For more information, see the wget man page.

$ man wget 

You might also like to read these following related articles.

  1. How to Download and Extract Tar Files with One Command
  2. 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites
  3. 15 Tips On How to Use ‘Curl’ Command in Linux

That’s all! In this short article, we have explained how to download files to a specific directory without moving into that directory, using wget. You can share your thoughts with us in the comments.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

How to Fix “passwd: Authentication token manipulation error” in Linux

Next Post

How to Create and Use Alias Command in Linux

Next Post

How to Create and Use Alias Command in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet