Prøve GULL - Gratis

A download manager for the shell – Convenient Downloads

Linux Magazine

|

#260/July 2022: Privacy

A few lines of shell code and the Gawk scripting language make downloading files off the web a breeze.

- By Goran Mladenovic

A download manager for the shell – Convenient Downloads

Almost everyone downloads data from the Internet. In most cases, you use the the web browser as the interface. Usually, websites offer files for download that you can click on individually in the browser. By default, the files usually end up in your Downloads/ folder. If you need to download a large number of files, manually selecting the storage location can quickly test your patience. Wouldn't it be easier if you had a tool to handle this job?

In this article, I will show you how to program a convenient download manager using Bash and a scripting language like Gawk. As an added benefit, you can add features that aren't available in similar programs, such as the ability to monitor the disk capacity or download files to the right folders based on their extensions.

Planning

Programming a download manager definitely requires good planning and a sensible strategy. Obviously, the download manager should download files, but it should also warn you when the hard disk threatens to overflow due to the download volume. Because most files have an extension (e.g., .jpg, .iso, or . epub), the download manager also can sort your files into appropriately named folders based on the extensions.

To build your own download manager, you will need two command-line programs that do not come preinstalled on modern Linux distributions by default: xclip and lynx. The xclip command-line tool monitors the clipboard, while lynx functions as a web browser for the terminal. Lynx also comes with several command-line options, making it usable as a link spider that offers many link display options.

Linux Magazine

Denne historien er fra #260/July 2022: Privacy-utgaven av Linux Magazine.

Abonner på Magzter GOLD for å få tilgang til tusenvis av kuraterte premiumhistorier og over 9000 magasiner og aviser.

Allerede abonnent?

FLERE HISTORIER FRA Linux Magazine

Linux Magazine

Exercise Place

The GRUB 2 boot manager might seem intimidating at first glance. All the more reason to spin up a virtual playground so you can practice.

time to read

10 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Terminal Mosaic

What's better than one command line? Many command lines that never die. Take the terminal to new places with Zellij.

time to read

9 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

MakerSpace

Build a Long-Range Sensor Network with ChirpStack Sensor Symphony

time to read

14 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

How Flatpak, AppImage, and Snap are changing software distribution Ship It!

Modern-day package systems solve some problems posed by classic formats like DEB and RPM. We look at Flatpak, AppImage, and Snap and describe how they differ.

time to read

12 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

Dashboard Delight

Simplify the chaos of self-hosted services with Homepage, a customizable dashboard with widgets that put service statistics at your fingertips.

time to read

9 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

MADDOG'S DOGHOUSE

Free software, and the FOSS community, can help technology students get the education they desire in Brazil and elsewhere.

time to read

3 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

Rethinking the Terminal

The Warp AI agent takes the guesswork out of working at the command line. We show you how to build a simple website with one prompt.

time to read

4 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Just in Time

Just is a command runner that lets you define project-specific tasks in a declarative justfile.

time to read

7 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

The Watcher

This versatile security app checks for vulnerabilities, watches logs, and acts as a single interface for other tools.

time to read

7 mins

#298/September 2025: Indie Game Studio

Linux Magazine

Linux Magazine

NO INTERNETREQUIRED

This new utility lets you update a system that is notconnected to the Internet.

time to read

4 mins

#298/September 2025: Indie Game Studio

Translate

Share

-
+

Change font size