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
Post a Comment