---
title: "How to Use YouTube-dl to Download Videos on Terminal"
description: "Learn to extract video and audio and how to use YouTube-DL to download videos from YouTube and others in this ATA Learning tutorial."
canonical: "https://adamtheautomator.com/how-to-use-youtube-dl/"
---

# How to Use YouTube-dl to Download Videos on Terminal

> Learn to extract video and audio and how to use YouTube-DL to download videos from YouTube and others in this ATA Learning tutorial.

Source: https://adamtheautomator.com/how-to-use-youtube-dl/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Use YouTube-dl to Download Videos on Terminal](https://adamtheautomator.com/wp-content/uploads/2023/08/how-to-use-youtube-dl.jpg)

# How to Use YouTube-dl to Download Videos on Terminal

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)9 August 20235 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Command Line](/tag/command-line/)

Table of Contents

*   [Prerequisites on How to Use YouTube-dl](#prerequisites-on-how-to-use-youtube-dl)
*   [Installing the yt-dlp CLI Tool on Ubuntu](#installing-the-yt-dlp-cli-tool-on-ubuntu)
*   [Upgrading the yt-dlp CLI Tool to the Latest Version](#upgrading-the-yt-dlp-cli-tool-to-the-latest-version)
*   [Installing FFmpeg for Enhanced Video Downloading Capabilities](#installing-ffmpeg-for-enhanced-video-downloading-capabilities)
*   [Downloading YouTube Videos via the yt-dlp CLI Tool](#downloading-youtube-videos-via-the-yt-dlp-cli-tool)
*   [Downloading Audio-Only From a YouTube Video](#downloading-audio-only-from-a-youtube-video)
*   [Downloading Videos Through a Proxy](#downloading-videos-through-a-proxy)
*   [Conclusion](#conclusion)

In this digital era where multimedia content reigns supreme, having the ability to download videos effortlessly has become an essential skill. If you are eager to elevate your video downloading game to the next level, why not learn how to use YouTube-dl (now `yt-dlp`)?

`yt-dlp` lets you download YouTube videos via your terminal by running a single command. And in this tutorial, you will learn how to download YouTube videos and extract audio only.

Keep reading and start downloading videos like a pro!

## Prerequisites on How to Use YouTube-dl

This tutorial comprises hands-on demonstrations in downloading videos. Ensure you have the following in place to follow along:

*   A Linux system – This tutorial uses Ubuntu 20.04.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

*   Python 3 and [Git](https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-20-04) installed on your machine.

Related:[How Do You Install Python 3.6?](https://adamtheautomator.com/install-python-36/)

*   A user with full `sudo` privileges.

Related:[How to Create User on Ubuntu Linux in Multiple Ways](https://adamtheautomator.com/create-user-on-ubuntu/)

## Installing the `yt-dlp` CLI Tool on Ubuntu

`yt-dlp` is a versatile and compact command-line program that facilitates video downloads from YouTube and many other video-sharing websites.

Unlike traditional applications with GUIs, `yt-dlp` operates directly through the command line. Installing this tool provides a powerful and flexible way to retrieve your favorite videos with just a one-line command.

To install `yt-dlp` on your system, follow these steps:

1\. Open your terminal and run the following [`apt update`](https://linuxize.com/post/how-to-use-apt-command/#updating-package-index-apt-update) command to update the local package index to ensure your system is up-to-date.

```bash
sudo apt update -y
```

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

![how to use youtube-dl - Updating the local package index](https://adamtheautomator.com/wp-content/uploads/2023/08/image-58.png)

Updating the local package index

2\. Next, execute the below `python` command to verify the current Phyton 3 version installed.

```bash
python3 -V
```

![Verifying the current installed Python 3 version](https://adamtheautomator.com/wp-content/uploads/2023/08/image-57.png)

Verifying the current installed Python 3 version

3\. With Python 3 verified, run the [`apt install`](https://linuxize.com/post/how-to-use-apt-command/#installing-packages-apt-install) command below to install the PIP package manager.

PIP will help streamline the installation process of the YouTube-dl tool on your system. A single command is all it takes to install YouTube-dl and the required dependencies.

```bash
sudo apt install python3-pip
```

When prompted, type **y** and press Enter to continue with the installation.

![Installing the PIP package manager](https://adamtheautomator.com/wp-content/uploads/2023/08/image-56.png)

Installing the PIP package manager

4\. Execute the following command to check the current PIP version installed.

```bash
sudo pip3 --version
```

![Verifying the PIP installed version](https://adamtheautomator.com/wp-content/uploads/2023/08/image-55.png)

Verifying the PIP installed version

5\. Now, run the below command to install `yt-dlp` via PIP. `yt-dlp` is a fork of the `youtube-dl` command-line video downloading tool.

> 💡 _The primary purpose of `yt-dlp` is to carry on the legacy of `youtube-dl`. Moreover, to continue the development of new features and improvements while staying in sync with the original `youtube-dl` project._

This command installs the latest development version (also known as the `master` branch) of `yt-dlp` directly from its [GitHub](https://adamtheautomator.com/git-checkout-remote-branch/) repository.

The `--force-reinstall` flag ensures that the package is reinstalled even if it was already installed, which helps update the latest version.

```bash
sudo python3 -m pip install -U pip setuptools wheel && sudo python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz>
```

![Installing yt-dlp using PIP](https://adamtheautomator.com/wp-content/uploads/2023/08/image-54.png)

Installing yt-dlp using PIP

Related:[Easily Perform Git Checkout Remote Branch \[Step-by-Step\]](https://adamtheautomator.com/git-checkout-remote-branch/)

> 💡 _Optionally, run the below command to install the latest stable version of `yt-dlp` instead. In this command, the `pip` module runs as a script within the Python interpreter to ensure you use the `pip` associated with Python 3._

```bash
sudo python3 -m pip install yt-dlp
```

![Installing the latest stable release version of yt-dlp](https://adamtheautomator.com/wp-content/uploads/2023/08/image-53.png)

Installing the latest stable release version of yt-dlp

6\. Once installed, execute the command below to verify your `yt-dlp` installation.

```bash
sudo yt-dlp --help
```

You will see a similar output as below if everything goes well.

![Verifying the yt-dlp installation](https://adamtheautomator.com/wp-content/uploads/2023/08/image-52.png)

Verifying the `yt-dlp` installation

## Upgrading the `yt-dlp` CLI Tool to the Latest Version

Exciting new features and enhancements await in each `yt-dlp` release. On that note, staying updated is essential to harness this tool’s full potential.

Upgrading ensures you enjoy the latest improvements, unleashing a more robust and feature-rich video downloading experience.

Execute the below command to upgrade (`-Up`) the `yt-dlp` CLI Tool to the latest version. This command automatically replaces any older version of `yt-dlp` you have on your system.

```bash
sudo python3 -m pip install -U yt-dlp
```

The output below shows the Requirement already satisfied messages since you installed the latest `yt-dlp` version

![Upgrading the yt-dlp CLI Tool to the latest version](https://adamtheautomator.com/wp-content/uploads/2023/08/image-60.png)

Upgrading the yt-dlp CLI Tool to the latest version

## Installing FFmpeg for Enhanced Video Downloading Capabilities

Typically, you would want to download videos of the highest quality possible. Installing FFmpeg, a powerful multimedia framework, provides tools for processing audio and video files.

Related:[Back to the Basics: Use and Install FFmpeg](https://adamtheautomator.com/install-ffmpeg/)

Execute the following command `install` `ffmpeg` on your system.

```bash
sudo apt-get install ffmpeg -y
```

![Installing FFmpeg](https://adamtheautomator.com/wp-content/uploads/2023/08/image-62.png)

Installing FFmpeg

Once installed, run the below command to verify if FFmpeg is appropriately installed.

```bash
ffmpeg -version
```

![Verifying the FFmpeg is adequately installed](https://adamtheautomator.com/wp-content/uploads/2023/08/image-61.png)

Verifying the FFmpeg is adequately installed

## **Downloading YouTube Videos via the `yt-dlp` CLI Tool**

With enhanced downloading capabilities, you can download your favorite YouTube videos. How? Downloading videos only takes a single command so long as you have a YouTube video’s URL.

> 💡 _While the name might suggest `yt-dlp` is only for downloading YouTube videos, this tool supports [many video streaming websites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)._

To download a YouTube video via the `yt-dlp` CLI tool:

1\. Open your web browser, navigate to [YouTube](https://youtube.com), search for a video to download, and copy its URL.

2\. Next, run the following `yt-dlp` command to download your preferred YouTube video. Ensure you replace the URL below with the one you copied in step one.

```bash
yt-dlp https://www.youtube.com/watch?v=_jco9nMMPr8
```

`yt-dlp` begins fetching the video from YouTube and displays the download progress in the terminal. The video is saved in your current working directory with the same name as the video on YouTube.

Note down the name of the file (_**The Ultimate Guide to Robocopy**_) or at least the video ID (i.e., _**\_jco9nMMPr8**_) for later use.

![Downloading a YouTube video](https://adamtheautomator.com/wp-content/uploads/2023/08/image-63.png)

Downloading a YouTube video

3\. Lastly, run either `ls` command below to verify your downloaded video file.

```bash
# Verify the downloaded video via the exact file name
ls -la "The Ultimate Guide to Robocopy [_jco9nMMPr8].mp4"
# Verify the downloaded video via the video ID
ls -la | grep "_jco9nMMPr8"
```

Related:[Master Grep with Regex and Make Troubleshooting a Breeze](https://adamtheautomator.com/grep-with-regex/)

![Verifying the downloaded video file](https://adamtheautomator.com/wp-content/uploads/2023/08/image-64.png)

Verifying the downloaded video file

## Downloading Audio-Only From a YouTube Video

You have just made your first YouTube video download, but what if you are only after the audio? After all, videos consume more space than audio.

Worry not! The `yt-dlp` tool lets you extract audio from a video, which is particularly useful if you are interested in music or podcast content only.

To extract and download the audio of a YouTube video:

Execute the following command, replacing `<YT_URL>` with your preferred YouTube video’s URL to extract and save the audio in `mp3` format.

You can also choose [different audio formats](https://github.com/yt-dlp/yt-dlp#post-processing-options), such as AAC or M4A, by changing the `--audio-format mp3` parameter to the desired format.

> 💡 _Downloading audio-only from a YouTube video opens possibilities like creating audiobooks. Moreover, opting for audio-only downloads helps conserve bandwidth, especially if you have a limited data plan, as video files are generally larger than audio files._

```bash
yt-dlp --extract-audio --audio-format mp3 <YT_URL>
```

![Downloading audio-only from a YouTube video](https://adamtheautomator.com/wp-content/uploads/2023/08/image-66.png)

Downloading audio-only from a YouTube video

Once the process completes, run the command below to list (`ls`) all (`-a`) audio files that are in `mp3` format in your working directory

```bash
ls -la *.mp3
```

![Listing all audio files that are in mp3 format](https://adamtheautomator.com/wp-content/uploads/2023/08/image-65.png)

Listing all audio files that are in mp3 format

## **Downloading Videos Through a Proxy**

In some instances, you may encounter restrictions or limitations while downloading YouTube videos directly from your network. The solution? Downloading the videos through a proxy.

By routing your video download requests through a proxy server, you bypass such restrictions and enjoy seamless video downloads.

Run the below `yt-dlp` command, replacing the following, to download a video through a proxy:

*   `[USERNAME:PASSWORD@PROXY_ADDRESS:PORT]` – The appropriate credentials and proxy details.
*   `[YT_URL]` – The URL of the YouTube video to download.

```bash
yt-dlp --proxy [USERNAME:PASSWORD@PROXY_ADDRESS:PORT] [YT_URL]
```

![Downloading videos through a proxy](https://adamtheautomator.com/wp-content/uploads/2023/08/image-68.png)

Downloading videos through a proxy

Finally, execute the following command to verify your downloaded video file.

```bash
ls -la | grep "_jco9nMMPr8"
```

![Verifying the video file downloaded through proxy](https://adamtheautomator.com/wp-content/uploads/2023/08/image-67.png)

Verifying the video file downloaded through proxy

## Conclusion

Throughout this tutorial, you have learned how to use YouTube-dl (now `yt-dlp`) CLI tool to download videos from YouTube with just a single command. But `yt-dlp` goes beyond just YouTube, making this tool a versatile and potent utility for grabbing online content.

With `yt-dlp` at your disposal, you can quickly download your favorite videos and extract audio to create audiobooks.

Now, what’s next? `yt-dlp` offers many options and parameters for fine-tuning your video downloads. Explore the [official documentation](https://github.com/yt-dlp/yt-dlp#usage-and-options) to discover advanced features like custom formats, subtitles, metadata, and more!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fhow-to-use-youtube-dl%2F&text=How%20to%20Use%20YouTube-dl%20to%20Download%20Videos%20on%20Terminal)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fhow-to-use-youtube-dl%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fhow-to-use-youtube-dl%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26989-monitor-windows-servers-prometheus-grafana-codex.webp)

### [How to Monitor Windows Servers with Prometheus and Grafana](/monitor-windows-servers-prometheus-grafana/)

Set up Windows Server monitoring with windows\_exporter, Prometheus, Grafana, and Alertmanager. Learn how to secure port 9182, scrape targets, and validate alerts.

![](https://adamtheautomator.com/wp-content/uploads/2026/05/featured_image-11.webp)

### [How to Troubleshoot Active Directory Replication Errors](/troubleshoot-active-directory-replication-errors/)

Troubleshoot Active Directory replication errors by isolating 1311, 1722, 2087, and USN rollback issues with repadmin, dcdiag, DNS, RPC, and KCC checks.

![](https://adamtheautomator.com/wp-content/uploads/2026/04/featured_image-6.webp)

### [How to Survive the 2026 Secure Boot Certificate Expiry](/survive-2026-secure-boot-certificate-expiry-3/)

Deploy Windows UEFI CA 2023 before the June 2026 certificate expiry. Inventory devices, update OEM firmware, and trigger enrollment via Intune or PowerShell registry settings.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
