Download YouTube Videos From Command Line In Ubuntu Linux, Unix And Mac

There are a number of browser add-ons and applications that offers a graphical user interface for downloading YouTube videos in Linux based operating systems. However, downloading a YouTube video from the command line can also be quite beneficial. For example, some servers do not have aGUI interface, whereas some up coming cloud based Linux OS may not allow installing applications. If for any reason you require or wish to download videos from the command line in Linux, try  YouTube-Dl. It downloads YouTube videos from the command line and works on Linux, Mac and Unix based operating systems.

Open the terminal from Applications –> Accessories –> Terminal  (in Ubuntu) and run the following command to install it.


sudo apt-get install youtube-dl


This will install YouTube-Dl, after which you will be able to download YouTube videos. Use the following command to download YouTube video.

youtube-dl –o filename.flv URL

Where filename.flv should be the name that you wish to give to the downloaded file (e.g. My Video) and URL is the address of the YouTube video. For e.g, see code below,

The following screenshot illustrates the download process of the video in Ubuntu Terminal: