How to play .MP3 files from command line with Termux

in utopian-io •  10 months ago

What Will I Learn?

  • How to play .MP3 files from command line with Termux


  • Termux
    You can download Termux Here


  • Intermediate

What Is Termux?


Just before we proceed to the steps taken to play .mp3 files with Termux, Its best adviced to actually know which of the folders the mp3 file is located. So lets check where the mp3 file we are going to use is stored.
The audio file we are going to play via Termux comand line is Goodlife.mp3 And it's saved in this directory \Home\SD card\music


Since we've located the file, lets check out the steps.


1: Install and launch Termux. Type this command clear to delete every initial text on the screen.

2: Install mpv by typing this command pkg install mpv
Mpv is simply a music player.

3: After typing the above command line, while its running, you will be told that some specific amount of disk space will be used. In my case it required 26.2mb. So reply y to grant it access.

Download in progress.

4: Once it has downloaded successfully, type this command cd / to set your Termux environment to root storage.

5: Now type ls to list the available files and folders in the root storage. Then type cd storage to open storage folder.

6: Now its time to select which of the storage folder our audio file ( goodlife.mp3) is located. since its located in sdcard1 now type cd storage


7: Type ls to list the available files and folders in the storage folder, Then type cd sdcard1 to open sdcard1 folder.

8: Type ls to list the available files and folders in the sdcard folder, Now type cd music to access the music folder. Because we saved our audio file in there.

9: This is the final stage. Type ls to list the files in the music folder as usual. After i typed it, i was able to see our mp3 file Goodlife.mp3. To play this file, we have to call the mpv we downloaded at the beginning of this tutorial to play the audio file by typing mpv goodlife.mp3

10: The audio file should start playing after that command.


This is the first tutorial i'm contributing using Ternmux.

Posted on - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.

mmmh, i won't talk, i will keep shut. ☺

Hey @rufans I am @utopian-io. I have just upvoted you!


  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!


  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!


Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord