File Mannagement and Selective Playing with mpg123

Tim Chase blinux.list at
Wed Dec 29 16:16:48 UTC 2010

On 12/29/2010 09:40 AM, RiverWind wrote:
> File management is becoming a bit of an interesting issue for me.
> I am looking for a utility that will allow me to go into a
> directory, cursor through files and make random and/or other types
> of selections by marking the chosen files prior to copying,
> deleting or moving them.

The first thing that comes to mind is using Lynx (the cat) in 
DIRED mode.  Just point it at a directory such as:

   bash$ lynx /home/riverwind

You can use "t" to tag/untag various files and then use "r"emove 
or "m"ove (or rename if only one is tagged) them to another 

Additionally, "mc" (Midnight Commander) is a super-powered 
console-based file-manager.

As a 3rd option, I occasionally use the "find" command to do 
things like this:

   find ~/mp3 \( -iname '*satriani*.mp3' -o -iname "*morse*.mp3" 
\) -exec mv {} /media/usb0/MUSIC \;

There's a LOT of power in the "find" command.

Yet one more option I sometimes use, I'll edit a file-list on the 
fly via pipes and then pipe that to a file or a shell:

   find ~/mp3  -iname '*.mp3' | grep -i "satriani" | sed "s at .*@cp 
'&' /media/usb0/MUSIC@' | sh

A variant of this last method can take your file list, let you 
open it in your editor of choice (vim for me) and then 
post-process it:

   # create the file with all your music
   find ~/mp3 -iname '*.mp3' > mp3.txt
   # edit, deleting the ones you don't want to play
   vi mp3.txt
   # create the copy commands you need to copy them
   # and then pipe the resulting commands through a shell
   sed "s at .*@cp '&' /media/usb0/MUSIC@" | sh

> When it comes to playing files using mpg123, I have learned to
> create and have the utility play it beautifully. However, is it
> possible to create a play list and then make individual selections
> from that list and have mpg123 play specifically selected files
> from a long list?

My first thought is just copy your file to a 2nd file, use your 
favorite text-editor to edit that new file (removing what you 
don't want), and then point mpg123 at that new file instead of 
the humongous original.

Hope this helps,


More information about the Blinux-list mailing list