Play Songs From TerminalšŸŽµ

Online music players are totally bloated with ads, Its time to find an alternative

Music symbol and guitar to signify music.


  • It looks cool on the internet
  • Reduces load on CPU caused by external media players
  • No ADS!!



# MacOS$ brew install youtube-dl mpv# Linux$ sudo apt-get install youtube-dl mpv
A Code Snippet from carbon


$ youtube-dl "<link>" -o "<output>"

If you only need the song not the video:

$ youtube-dl -F "<link>"

It give all the formats of the download that is possible, chose the id of the format that you need (Generally 140 .m4a works).

$ youtube-dl -f 140 "<link>" -o "<output.m4a>"

Now that the songs are downloaded we need to start playing them.

$ mpv <song>.m4a

If you want all the songs to play, use piping in terminal

$ ls | grep ".m4a" | xargs -r mpv

This will eliminate the need for other media players and remove the dependence on music websites. If you wish you can put this in a function and just call the function whenever you need directly from the terminal.

Check Out my other Blogs: BlogsšŸ“•.

Krishna Kotni. Website: