Commands.page Logo

Ubuntu Command to Download File With User Config

This article identifies the wget command as the primary tool for downloading files in Ubuntu while utilizing a specific user directory for configuration settings. It outlines where the configuration file is located and how to modify it for personalized download behavior without affecting system-wide settings.

The command you are looking for is wget. When executed, wget automatically looks for a configuration file in your specific user home directory to customize its behavior. This allows you to set default options that apply only to your user account rather than the entire system.

Configuration File Location

The user-specific configuration file for wget is located at ~/.wgetrc. The tilde symbol (~) represents your home directory, such as /home/username/. If this file exists, wget reads it every time you run a download command.

How to Set Up User Config

To create or edit your user configuration file, open the terminal and use a text editor like nano:

nano ~/.wgetrc

You can add various directives to this file. For example, to always continue interrupted downloads, add the following line:

continue = on

To save the file in nano, press Ctrl + O, then Enter, and exit with Ctrl + X.

Using the Command

Once configured, you simply run the wget command followed by the URL. The tool will apply your user-specific settings automatically.

wget https://example.com/file.zip

This ensures your download preferences persist across sessions without requiring command-line flags every time.