Last updated on

Quick Guide to Playing Local Music with mpv on Linux


Introduction

Looking for a simple way to play your local music files directly from the terminal on Linux? The mpv CLI tool offers a straightforward solution with minimal setup and easy controls. Here’s how you can get started quickly.

Installation

To get started with mpv, you need to install it. For Debian/Ubuntu-based systems, open your terminal and run:

sudo apt install mpv

For other Linux distributions, use the appropriate package manager. For example, on Fedora use sudo dnf install mpv, and on Arch Linux use sudo pacman -S mpv.

Usage

  1. Navigate to Your Music Directory:

    Use the cd command to go to the folder containing your MP3 files.

    cd /path/to/your/music
    
  2. Play Music Files:

    Run mpv in the directory to start playing the files.

    mpv .
    

Essential Commands to Know

  • Play/Pause: Space
  • Stop Playback: q
  • Next Song: > (tip: press Shift) or Enter
  • Previous Song: < (tip: press Shift)
  • Volume Up: 0
  • Volume Down: 9
  • Mute/Unmute: m
  • Seek Forward: Right Arrow (5 secs) & Up Arrow (1 min)
  • Seek Backward (5 seconds): Left Arrow (5 secs) & Down Arrow (1 min)
  • Quit: q or Ctrl+C

Additional Tips

  • Playlist Support: mpv can also play playlists. Simply add a playlist file (e.g., .m3u) to your directory and run mpv playlist.m3u.
  • Configuration: Customize mpv settings by creating a configuration file at ~/.config/mpv/mpv.conf.

Conclusion

With these commands and tips, you’re all set to enjoy your music collection using mpv. This tool offers a clean and efficient way to handle your audio files directly from the terminal. Happy listening!