Results 1 to 3 of 3

Thread: [ls+mplayer]recurcive directory cat question

  1. #1
    Join Date
    Jul 2008
    Location
    ukraine/mk/pervomaysk
    Posts
    528

    Default [ls+mplayer]recurcive directory cat question

    i believe this is a wright place to post such article

    i want give list of the files in music directory to mplayer's input

    in current directory i can play this way

    ls *.ogg|mplayer *.*

    ls -R

    give the list of all files in sub-directories

    ls -R *.ogg|mplayer *.*

    i have nothing...

    please help with advise on my question.
    intelGMA3100#amd|radeonHD4200+radeonHD5450@catalyst12.4
    WC5020B,PagePro1480MF,LBP2900,hpCP1510,PHOTO1290,Scanmaker3600,PerfectionV200

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: [ls+mplayer]recurcive directory cat question

    Quote Originally Posted by didencool View Post
    i believe this is a wright place to post such article

    i want give list of the files in music directory to mplayer's input

    in current directory i can play this way

    ls *.ogg|mplayer *.*
    You are under a misunderstanding here. The ls does nothing useful. mplayer does not read input for a list of files. The reason it happens to work is because *.* matches any file with a dot in the middle of the name and certainly matches any file ending in .ogg. mplayer probably ignores the non .ogg files.

    ls -R

    give the list of all files in sub-directories

    ls -R *.ogg|mplayer *.*

    i have nothing...

    please help with advise on my question.
    Try this:

    Code:
    find . -name '*.ogg' -print0 | xargs -0 mplayer
    This also handles files with spaces in them by the way. You'd have to read up on find and xargs to understand how this works.

  3. #3
    Join Date
    Jul 2008
    Location
    ukraine/mk/pervomaysk
    Posts
    528

    Default Re: [ls+mplayer]recurcive directory cat question

    thank you very much
    this is completely new to me. i did not use nor find and xarg i will read about this thank you ken_yap one more time...
    intelGMA3100#amd|radeonHD4200+radeonHD5450@catalyst12.4
    WC5020B,PagePro1480MF,LBP2900,hpCP1510,PHOTO1290,Scanmaker3600,PerfectionV200

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •