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
-
Navigate to Your Music Directory:
Use the
cd
command to go to the folder containing your MP3 files.cd /path/to/your/music
-
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: pressShift
) orEnter
- Previous Song:
<
(tip: pressShift
) - 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
orCtrl+C
Additional Tips
- Playlist Support: mpv can also play playlists. Simply add a playlist file (e.g.,
.m3u
) to your directory and runmpv 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!