command line - How to play only specific files in MPlayer? - Ask Ubuntu


the problem: i've example 16 tracks in 1 folder want play 1 - 7. how do in mplayer? following:

mplayer 1.mp3 - 7.mp3 

is not right way. possible in mplayer without writing out every filename?

as far aware not possible within mplayer little command line magic can produce great results.

the following perhaps little clumsy works enough here naming convention have specified:

mplayer $(find . -maxdepth 1 -name "[1-7].mp3" | ls -v) 

brief explanation:

  • find . -maxdepth 1: search in current directory no recursion.
  • -name "[1-7].mp3": find mp3s have numerals 1-7 filename. [1-7] section demonstrates bash range expression numbers 1 , 7 matched numbers between.
  • ls -v : sort search playback numerically based.

doubtless there other ways works enough , if actual filenames different matter of changing regular expression in find syntax match...


Comments

Popular posts from this blog

debian - Kali Linux - Debootstrap error Failed to determine codename for the release - Super User

crash - Windows Rundll32 (child process of DllHost) is crashing. How can I even identify it? - Super User

Windows XP installation, no previous version of Windows NT - Super User