1MPC(1)                                mpc                               MPC(1)
2
3
4

NAME

6       mpc - mpc Documentation
7

DESCRIPTION

9       mpc  is  a  command-line  client for the Music Player Daemon (MPD).  It
10       connects to a MPD and controls it according to commands  and  arguments
11       passed  to  it.   If no command is given, the current status is printed
12       (same as "mpc status").
13

SYNOPSIS

15          mpc [options] <command> [<arguments>]
16

OPTIONS

18       -f, --format
19              Configure the format used to display songs.
20
21              The metadata delimiters are:
22
23                       ┌───────────────┬────────────────────────────┐
24                       │Name           │ Description                │
25                       ├───────────────┼────────────────────────────┤
26                       │%name%         │ A  name  for  this   song. │
27                       │               │ This  is  not the song ti‐ │
28                       │               │ tle. The exact meaning  of │
29                       │               │ this  tag  is not well-de‐ │
30                       │               │ fined. It is often used by │
31                       │               │ badly  configured internet │
32                       │               │ radio stations with broken │
33                       │               │ tags  to  squeeze both the │
34                       │               │ artist name and  the  song │
35                       │               │ title in one tag.          │
36                       ├───────────────┼────────────────────────────┤
37                       │%artist%       │ Artist file tag            │
38                       ├───────────────┼────────────────────────────┤
39                       │%album%        │ Album file tag             │
40                       ├───────────────┼────────────────────────────┤
41                       │%albumartist%  │ Album Artist file tag      │
42                       ├───────────────┼────────────────────────────┤
43                       │%comment%      │ Comment  file tag (not en‐ │
44                       │               │ abled   by   default    in │
45                       │               │ mpd.conf's           meta‐ │
46                       │               │ data_to_use)               │
47                       ├───────────────┼────────────────────────────┤
48                       │%composer%     │ Composer file tag          │
49                       ├───────────────┼────────────────────────────┤
50                       │%date%         │ Date file tag              │
51                       ├───────────────┼────────────────────────────┤
52                       │%originaldate% │ Original Date file tag     │
53                       ├───────────────┼────────────────────────────┤
54                       │%disc%         │ Disc file tag              │
55                       ├───────────────┼────────────────────────────┤
56                       │%genre%        │ Genre file tag             │
57                       ├───────────────┼────────────────────────────┤
58                       │%performer%    │ Performer file tag         │
59                       ├───────────────┼────────────────────────────┤
60                       │%title%        │ Title file tag             │
61                       ├───────────────┼────────────────────────────┤
62                       │%track%        │ Track file tag             │
63                       ├───────────────┼────────────────────────────┤
64                       │%time%         │ Duration of file           │
65                       └───────────────┴────────────────────────────┘
66
67                       │%file%         │ Path of file, relative  to │
68                       │               │ MPD's      music_directory 
69                       │               │ variable                   │
70                       ├───────────────┼────────────────────────────┤
71                       │%position%     │ Queue track number         │
72                       ├───────────────┼────────────────────────────┤
73                       │%id%           │ Queue track id number      │
74                       ├───────────────┼────────────────────────────┤
75                       │%prio%         │ Priority in  the  (random) │
76                       │               │ queue.                     │
77                       ├───────────────┼────────────────────────────┤
78                       │%mtime%        │ Date and time of last file │
79                       │               │ modification               │
80                       ├───────────────┼────────────────────────────┤
81                       │%mdate%        │ Date of last file  modifi‐ │
82                       │               │ cation                     │
83                       └───────────────┴────────────────────────────┘
84
85              The [] operator is used to group output such that if no metadata
86              delimiters are found or matched between [ and ],  then  none  of
87              the  characters between [ and ] are output.  & and | are logical
88              operators for and and or.  # is used to escape characters.  Some
89              useful examples for format are: "%file%" and "[[%artist% - ]%ti‐
90              tle%]|[%file%]".  This command also takes the following  defined
91              escape sequences:
92
93                                   ┌───┬─────────────────┐
94                                   │\  │ backslash       │
95                                   ├───┼─────────────────┤
96                                   │\[ │ left bracket    │
97                                   ├───┼─────────────────┤
98                                   │\] │ right bracket   │
99                                   ├───┼─────────────────┤
100                                   │\a │ alert           │
101                                   ├───┼─────────────────┤
102                                   │\b │ backspace       │
103                                   ├───┼─────────────────┤
104                                   │\e │ escape          │
105                                   ├───┼─────────────────┤
106                                   │\t │ tab             │
107                                   ├───┼─────────────────┤
108                                   │\n │ newline         │
109                                   ├───┼─────────────────┤
110                                   │\v │ vertical tab    │
111                                   ├───┼─────────────────┤
112                                   │\f │ form-feed       │
113                                   ├───┼─────────────────┤
114                                   │\r │ carriage return │
115                                   └───┴─────────────────┘
116
117              If  not  given, the value of the environment variable MPC_FORMAT
118              is used.
119
120       --wait Wait for operation to finish (e.g. database update).
121
122       --range=[START]:[END]
123              Operate on a range (e.g. when loading a playlist).  START is the
124              first index of the range, END is the first index after the range
125              (i.e. excluding).  START and END  may  be  omitted,  making  the
126              range open to that end.  Indexes start with zero.
127
128       -q, --quiet, --no-status
129              Prevents  the  current song status from being printed on comple‐
130              tion of some of the commands.
131
132       --verbose
133              Verbose output.
134
135       --host=HOST
136              The MPD server to connect to.  This can be a hostname, IPv4/IPv6
137              address, an absolute path (i.e. local socket) or a name starting
138              with @ (i.e. an abstract socket, Linux only).
139
140              To use a password, provide a value of the form "password@host".
141
142              If not given, the value of the environment variable MPD_HOST  is
143              used.
144
145       --port=PORT, -p PORT
146              The TCP port of the MPD server to connect to.
147
148              If  not given, the value of the environment variable MPD_PORT is
149              used.
150

COMMANDS

152       Commands can be used from the least unambiguous prefix (e.g  insert  or
153       ins).
154
155   Player Commands
156       consume <on|off> - Toggle consume mode if state (on
157              or off) is not specified.
158
159       crossfade [<seconds>] - Gets and sets the current amount of
160              crossfading between songs (0 disables crossfading).
161
162       current [--wait] - Show the currently playing song.  With
163              --wait,  mpc  waits until the song changes (or until playback is
164              started/stopped) before it queries the  current  song  from  the
165              server.
166
167       queued - Show the currently queued (next) song.
168
169       mixrampdb [<db>] - Gets and sets the volume level at which
170              songs  with  MixRamp  tags will be overlapped. This disables the
171              fading of the crossfade command  and  simply  mixes  the  songs.
172              -50.0 will effectively remove any gaps, 0.0 will mash tracks to‐
173              gether. The amount of  overlap  is  limited  by  the  audio_buf‐
174              fer_size MPD configuration parameter.
175
176       mixrampdelay [<seconds>] - Gets and sets the current amount
177              of  extra  delay  added  to  the value computed from the MixRamp
178              tags. (A negative value disables overlapping with MixRamp  tagqs
179              and restores the previous value of crossfade).
180
181       next - Starts playing next song on queue.
182
183       pause - Pauses playing.
184
185       play <position> - Starts playing the song-number
186              specified. If none is specified, plays number 1.
187
188       prev - Starts playing previous song.
189
190       random <on|off> - Toggle random mode if state (on
191              or off) is not specified.
192
193       repeat <on|off> - Toggle repeat mode if state (on
194              or off) is not specified.
195
196       replaygain [<off|track|album>] - Sets the replay gain mode.
197              Without arguments, it prints the replay gain mode.
198
199       single <on|off> - Toggle single mode if state (on
200              or off) is not specified.
201
202       seek [+-][<HH:MM:SS>] or <[+-]<0-100>%> - Seeks by hour,
203              minute  or seconds, hours or minutes can be omitted.  If seeking
204              by percentage, seeks within the current song  in  the  specified
205              manner.   If  a + or - is used, the seek is done relative to the
206              current song position. Absolute seeking by default.
207
208       seekthrough [+-][<HH:MM:SS>] - Seeks by hour,
209              minute or seconds, hours or minutes can be  omitted,  relatively
210              to  the  current  position. If the duration exceeds the limit of
211              the current song, the seek command proceeds to seek through  the
212              playlist  until  the  duration  is reached.  If a + is used, the
213              seek is forward. If a - is used, the seek is  backward.  Forward
214              seeking by default.
215
216       stop - Stops playing.
217
218       toggle - Toggles between play and pause. If stopped starts
219              playing.   Does  not  support  start playing at song number (use
220              play).
221
222   Queue Commands
223       add <file> - Adds a song from the music database to the
224              queue. Can also read input from pipes. Use "mpc add  /"  to  add
225              all files to the queue.
226
227       insert <file> - The insert command works similarly to
228              add  except  it  adds  song(s)  after the currently playing one,
229              rather than at the end.  When random mode is  enabled,  the  new
230              song is queued after the current song.
231
232       clear - Empties the queue.
233
234       crop - Remove all songs except for the currently playing
235              song.
236
237       del <songpos> - Removes a queue number from the queue. Can
238              also read input from pipes (0 deletes the current playing song).
239
240       mv, move <from> <to> - Moves song at position <from> to the
241              position <to> in the queue.
242
243       searchplay <type> <query> [<type> <query>]... - Search the
244              queue for a matching song and play it.
245
246       shuffle - Shuffles all songs on the queue.
247
248   Playlist Commands
249       load <file> - Loads <file> as queue.  The option --range may be used to
250       load only a portion of the file (requires libmpdclient 2.16).
251
252       lsplaylists: - Lists available playlists.
253
254       playlist [<playlist>] - Lists all songs in <playlist>. If
255              no <playlist> is specified,  lists  all  songs  in  the  current
256              queue.
257
258       rm <file> - Deletes a specific playlist.
259
260       save <file> - Saves playlist as <file>.
261
262   Database Commands
263       listall [<file>] - Lists <file> from database.  If no
264              <file> is specified, lists all songs in the database.
265
266       ls [<directory>] - Lists all files/folders in
267              <directory>.  If no <directory> is specified, lists all files in
268              music directory.
269
270       search <type> <query> [<type> <query>]... - Searches for
271              substrings in song tags.  Any number of tag type and query  com‐
272              binations can be specified.  Possible tag types are: artist, al‐
273              bum, title, track, name, genre, date, composer, performer,  com‐
274              ment, disc, filename, or any (to match any tag).
275
276       search  <expression>  -  Searches  with  a  filter expression, e.g. mpc
277       search '((artist == "Kraftwerk") AND (title == "Metall auf  Metall"))'.
278       Check  the  MPD protocol documentation for details.  This syntax can be
279       used with find andd findadd as well.  (Requires libmpdclient  2.16  and
280       MPD 0.21)
281
282       find <type> <query> [<type> <query>]... - Same as search,
283              but  tag  values  must match <query>s exactly instead of doing a
284              substring match.
285
286       findadd <type> <query> [<type> <query>]... - Same as find,
287              but add the result to the  current  queue  instead  of  printing
288              them.
289
290       list <type> [<type> <query>]... - Return a list of all tags
291              of given tag <type>.  Optional search <type>s/<query>s limit re‐
292              sults in a way similar to search.
293
294       stats - Displays statistics about MPD.
295
296       update [--wait] [<path>] - Scans for updated files in the
297              music directory.  The optional parameter <path> (relative to the
298              music directory) may limit the scope of the update.
299
300              With --wait, mpc waits until MPD has finished the update.
301
302       rescan [--wait] [<path>] - Like update, but also rescans
303              unmodified files.
304
305   Mount Commands
306       mount - Lists all mounts.
307
308       mount <uri> <storage> - Create a new mount.
309
310       unmount <uri> - Remove a mount.
311
312   Sticker Commands
313       The sticker command allows you to get and set song stickers.
314
315       sticker <file> set <key> <value> - Set the value of a song
316              sticker.
317
318       sticker <file> get <key> - Print the value of a song
319              sticker.
320
321       sticker <file> list - List all stickers of a song.
322
323       sticker <file> delete <key> - Delete a song sticker.
324
325       sticker <dir> find <key> - Search for stickers with the
326              specified name, below the specified directory.
327
328   Output Commands
329       volume [+-]<num> - Sets the volume to <num> (0-100).  If
330              +  or - is used, then it adjusts the volume relative to the cur‐
331              rent volume.
332
333       outputs - Lists all available outputs
334
335       disable [only] <output # or name> [...] - Disables the
336              output(s); a list of one or more names or numbers  is  required.
337              If "only" is the first argument, all other outputs are enabled.
338
339       enable [only] <output # or name> [...] - Enables the
340              output(s);  a  list of one or more names or numbers is required.
341              If "only" is the first argument, all other outputs are disabled.
342
343       toggleoutput <output # or name> [...] - Changes the
344              status for the given output(s); a list of one or more  names  or
345              numbers is required.
346
347   Client-to-client Commands
348       channels - List the channels that other clients have
349              subscribed to.
350
351       sendmessage <channel> <message> - Send a message to the
352              specified channel.
353
354       waitmessage <channel> - Wait for at least one message on
355              the specified channel.
356
357       subscribe <channel> - Subscribe to the specified channel
358              and continuously receive messages.
359
360   Other Commands
361       idle [events] - Waits until an event occurs.  Prints a list
362              of  event  names, one per line.  See the MPD protocol documenta‐
363              tion for further information.
364
365              If you specify a list of events, only these events  are  consid‐
366              ered.
367
368       idleloop [events] - Similar to idle, but
369              re-enters "idle" state after events have been printed.
370
371              If  you  specify a list of events, only these events are consid‐
372              ered.
373
374       version - Reports the version of MPD.
375

ENVIRONMENT VARIABLES

377       All environment variables are overridden by any  values  specified  via
378       command line switches.
379
380       MPC_FORMAT
381              Configure   the  format  used  to  display  songs.   See  option
382              --format.
383
384       MPD_HOST
385              The MPD server to connect to.  See option --host.
386
387       MPD_PORT
388              The TCP port of the  MPD  server  to  connect  to.   See  option
389              --port.
390

BUGS

392       Report bugs on https://github.com/MusicPlayerDaemon/mpc/issues
393
394       Since  MPD  uses  UTF-8, mpc needs to convert characters to the charset
395       used by the local system.  If you get character conversion errors  when
396       you're  running  mpc  you probably need to set up your locale.  This is
397       done by setting any of the LC_CTYPE, LANG or LC_ALL  environment  vari‐
398       ables (LC_CTYPE only affects character handling).
399

SEE ALSO

401       mpd(1)
402

AUTHOR

404       See
405       https://raw.githubusercontent.com/MusicPlayerDaemon/mpc/master/AUTHORS
406

AUTHOR

408       Max Kellermann
409
411       Copyright 2003-2018 The Music Player Daemon Project
412
413
414
415
4160.33                             Jul 22, 2021                           MPC(1)
Impressum