 |
|
| |
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").
mpc [options] <command> [--]
[<arguments>]
After --, all parameters are considered to be arguments,
not options, even if they start with a dash.
- -f, --format
- Configure the format used to display songs.
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 |
%audioformat% |
The audio format of the song. |
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.
- --wait
- Wait for operation to finish (e.g. database update).
- --range=[START]:[END]
- Operate on a range (e.g. when loading a playlist). START is the first
index of the range, END is the first index after the range (i.e.
excluding). START and END may be omitted, making the range open to that
end. Indexes start with zero.
- --with-prio
- Show only songs that have a non-zero priority.
- --host=HOST
- The MPD server to connect to. This can be a hostname, IPv4/IPv6 address,
an absolute path (i.e. local socket) or a name starting with @
(i.e. an abstract socket, Linux only).
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.
- --port=PORT, -p
PORT
- The TCP port of the MPD server to connect to.
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.
- random
<on|off> - Toggle random mode if state (on
- or off) is not specified.
- repeat
<on|off> - Toggle repeat mode if state (on
- or off) is not specified.
- replaygain
[<off|track|album>] - Sets the replay gain mode.
- Without arguments, it prints the replay gain mode.
- single
<on|once|off> - Toggle single mode if state (on,
- once, or off) is not specified. once toggles to
off.
- seek [+-][<HH:MM:SS>]
or <[+-]<0-100>%> - Seeks by hour,
- minute or seconds, hours or minutes can be omitted. If seeking by
percentage, seeks within the current song in the specified manner. If a
+ or - is used, the seek is done relative to the current
song position. Absolute seeking by default.
- seekthrough
[+-][<HH:MM:SS>] - Seeks by hour,
- minute or seconds, hours or minutes can be omitted, relatively to the
current position. If the duration exceeds the limit of the current song,
the seek command proceeds to seek through the playlist until the duration
is reached. If a + is used, the seek is forward. If a - is
used, the seek is backward. Forward seeking by default.
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>.
renplaylist <playlist> <new playlist> - Rename
a playlist.
clearplaylist <playlist> - Clear the playlist name
(i.e. truncate playlist.m3u).
- listall
[<file>] - Lists <file> from database. If no
- file is specified, lists all songs in the database.
- ls [<directory>] -
Lists all files/folders in
- directory. If no directory is specified, lists all files in
music directory.
- lsdirs
[<directory>] - List subdirectories of
- directory. If no directory is specified, lists
subdirectories in music directory.
- search <type>
<query> [<type> <query>]... - Searches for
- substrings in song tags. Any number of tag type and query combinations can
be specified. Possible tag types are: artist, album, title, track, name,
genre, date, composer, performer, comment, disc, filename, or any (to
match any tag).
- search
<expression> - Searches with a filter expression,
e.g.:
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)
- find <type>
<query> [<type> <query>]... - Same as
- search, but tag values must match query exactly instead of
doing a substring match.
- findadd <type>
<query> [<type> <query>]... - Same as
- find, but add the result to the current queue instead of printing
them.
- list <type>
[<type> <query>]... [group <type>]... -
Return
- a list of all tags of given tag type. Optional search
type/query limit results in a way similar to search. Results
can be grouped by one or more tags. Example:
mpc list album group artist
stats - Displays statistics about MPD.
mount - Lists all mounts.
unmount <mount-path> - Remove a mount.
- listneighbors
- Print a list of "neighors"
- (i.e. automatically detected storages which can be mounted). This requires
enabling at least one neighbor plugin in mpd.conf.
Example:
$ 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
partitions - Lists all available partitions
makepart <name> [...] - Creates new partitions
delpart <name> [...] - Deletes partitions
- idle [events] - Waits
until an event occurs. Prints a list
- of event names, one per line. See the MPD protocol documentation for
further information.
If you specify a list of events, only these events are
considered.
- idleloop
[events] - Similar to idle, but
- re-enters "idle" state after events have been printed.
If you specify a list of events, only these events are
considered.
- status [format] -
Without an argument print a three line status
- output equivalent to "mpc" with no arguments. If a format string
is given then the delimiters are processed exactly as how they are for
metadata. See the '-f' option in Options
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', 'paused' or 'stopped' |
%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' |
%kbitrate% |
The bit rate in kbps for the current song. |
%audioformat% |
The audio format which MPD is currently playing as
'samplerate:bits:channels'. |
%samplerate% |
The sample rate in Hz extracted from the current MPD audio
format. |
%bits% |
The number of significant bits per sample size extracted from the
current MPD audio format. |
%channels% |
The number of channels extracted from the current MPD audio
format. |
- version - Reports
the version of the protocol spoken, not the real
- version of the daemon.
All environment variables are overridden by any values specified
via command line switches.
- MPC_FORMAT
- Configure the format used to display songs. See option
--format.
- MPD_HOST
- The MPD server to connect to. See option --host.
- MPD_PORT
- The TCP port of the MPD server to connect to. See option
--port.
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
Copyright 2003-2021 The Music Player Daemon Project
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
|