MPC(1) | mpc | MPC(1) |
mpc - mpc Documentation
mpc is a command-line client for the Music Player Daemon (MPD). It connects to a MPD and controls it according to commands and arguments passed to it. If no command is given, the current status is printed (same as "mpc status").
The metadata delimiters are:
Name | Description |
%name% | A name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag. |
%artist% | Artist file tag |
%album% | Album file tag |
%albumartist% | Album Artist file tag |
%comment% | Comment file tag (not enabled by default in mpd.conf's metadata_to_use) |
%composer% | Composer file tag |
%date% | Date file tag |
%originaldate% | Original Date file tag |
%disc% | Disc file tag |
%genre% | Genre file tag |
%performer% | Performer file tag |
%title% | Title file tag |
%track% | Track file tag |
%time% | Duration of file |
%file% | Path of file, relative to MPD's music_directory variable |
%position% | Queue track number |
%id% | Queue track id number |
%prio% | Priority in the (random) queue. |
%mtime% | Date and time of last file modification |
%mdate% | Date of last file modification |
The [] operator is used to group output such that if no metadata delimiters are found or matched between [ and ], then none of the characters between [ and ] are output. & and | are logical operators for and and or. # is used to escape characters. Some useful examples for format are: "%file%" and "[[%artist% - ]%title%]|[%file%]". This command also takes the following defined escape sequences:
\ | backslash |
\[ | left bracket |
\] | right bracket |
\a | alert |
\b | backspace |
\e | escape |
\t | tab |
\n | newline |
\v | vertical tab |
\f | form-feed |
\r | carriage return |
If not given, the value of the environment variable MPC_FORMAT is used.
To use a password, provide a value of the form "password@host".
If not given, the value of the environment variable MPD_HOST is used.
If not given, the value of the environment variable MPD_PORT is used.
Commands can be used from the least unambiguous prefix (e.g insert or ins).
queued - Show the currently queued (next) song.
next - Starts playing next song on queue.
pause - Pauses playing.
prev - Starts playing previous song.
stop - Stops playing.
clear - Empties the queue.
shuffle - Shuffles all songs on the queue.
lsplaylists: - Lists available playlists.
rm <file> - Deletes a specific playlist.
save <file> - Saves playlist as <file>.
mpc search '((artist == "Kraftwerk") AND (title == "Metall auf Metall"))'
Check the MPD protocol documentation for details. This syntax can be used with find and findadd as well. (Requires libmpdclient 2.16 and MPD 0.21)
mpc list album group artist
stats - Displays statistics about MPD.
With --wait, mpc waits until MPD has finished the update.
mount - Lists all mounts.
mpc mount server nfs://10.0.0.5/mp3 mpc mount stick udisks://by-id-ata-FOO-part2
unmount <mount-path> - Remove a mount.
$ mpc listneighbors upnp://uuid:01234567-89ab-cdef-0123-456789abcdef/urn:schemas-upnp-org:service:ContentDirectory:1 udisks://by-id-dm-name-_dev_sdb3 udisks://by-id-ata-FOO-part2
The sticker command allows you to get and set song stickers.
sticker <file> list - List all stickers of a song.
sticker <file> delete <key> - Delete a song sticker.
outputs - Lists all available outputs
If you specify a list of events, only these events are considered.
If you specify a list of events, only these events are considered.
Name | Description |
%totaltime% | The total duration of the song. |
%currenttime% | The time that the client is currently at. |
%percenttime% | The percentage of time elapsed for the current song. |
%songpos% | The position of the current song within the playlist. |
%length% | The number of songs within the playlist |
%state% | Either 'playing' or 'paused' |
%volume% | The current volume spaced out to 4 characters including a percent sign |
%random% | Current status of random mode. 'on' or 'off' |
%repeat% | Current status of repeat mode. 'on' or 'off' |
%single% | Current status of single mode. 'on', 'once', or 'off' |
%consume% | Current status of consume mode. 'on' or 'off' |
All environment variables are overridden by any values specified via command line switches.
Report bugs on https://github.com/MusicPlayerDaemon/mpc/issues
Since MPD uses UTF-8, mpc needs to convert characters to the charset used by the local system. If you get character conversion errors when you're running mpc you probably need to set up your locale. This is done by setting any of the LC_CTYPE, LANG or LC_ALL environment variables (LC_CTYPE only affects character handling).
See https://raw.githubusercontent.com/MusicPlayerDaemon/mpc/master/AUTHORS
Max Kellermann
Copyright 2003-2021 The Music Player Daemon Project
September 18, 2022 | 0.34 |