-   Linux - Newbie (
-   -   error with find . | xargs (

cbonar 12-09-2004 09:53 AM

error with find . | xargs
arrrghh !!!

I want to play all movies in all SUBdirectories of the current one.

So I tried :

find . | xargs mplayer
but it says (in french, although it's almost not understandable) :

xargs: Le paramètre simple n'est pas repérable par apostrophe.
which would approximately be (in english) :

xargs: The (bare?|simple?|unique?) parameter is not (locatable?) with quotes.

What did I make wrong ?

I also tried :

find . -mindepth 1 | xargs mplayer
so I don't have the "." entry, but I got the same error message...


Here's a sample of the output of the former find . command (top and bottom) :

./dos/depart/backstart-men-good position.mpg



visaris 12-09-2004 09:58 AM

Maybe you want to try somthing like this? :


prompt> find . -name "*word_you_are_looking_for_here*" -print
or maybe even:


prompt> find . | grep word_you_are_looking_for_here
Hope that helps!

visaris 12-09-2004 10:02 AM

Gosh, I'm sorry. I didn't even read all of your post.

I use mplayer to play all my movies like so:


prompt> mplayer *.mpeg *.avi *.mpg
It should be that simple. I do use extra options, so my actual line is more like:


prompt> mplayer -fs -loop 0 *.mpeg *.avi *.mpg
(great for pr0n...)

visaris 12-09-2004 10:09 AM

Gee, I don't know what's wrong with me today. I misread your post _twice_.

Try this:


find . -print | grep .mpeg | xargs mplayer
The only reason, I can think of that this doesn't work is that your filenames or directories might contain spaces or quote characters...

cbonar 12-09-2004 10:18 AM

Thanks for you 3 posts !!! LOL


find . -print | grep .mpg | xargs mplayer
behaves exactly the same... :(

The weird thing is that I've used this pattern (find . | xargs) for a long time, and it used to work...
I must miss some important thing, but I don't see which one...

visaris 12-09-2004 10:22 AM

Maybe you can play around with xargs to try and feel it out? Maybe put the paths of a few movies in a file, and they do somthing like:


cat file_with_movie_paths_here | xargs
I think xargs defaults to echo, so this should give you the contents of the original file back.. Maybe if you play with it like this you can gain more insight into what is wrong?

cbonar 12-09-2004 11:08 AM

Well, the problem seems to come from the maximum amount of chars (20K according to the man page) xargs can handle (what the error message doesn't lead to understand).

I'm still dubious about that, because :
  • find . | wc -m gives me 13379 characters, which is still under 20000 AFAIK
  • find . | xargs -s 50000 mplayer, which should allow xargs to handle up to 50K characters, gives me the exact same error


I think I'll have to fall back with a find . -exec mplayer "{}" \; which I don't like because I never remember the exact syntax, and furthermore it spans multiple successive mplayer instances, so I cannot stop the whole playlist by typing 'q' at mplayer...


cbonar 12-09-2004 11:22 AM

Ok, I've found another way to do it, less convenient, but easy to remember.
However, it should only work with mplayer since it uses its ability to read play lists.


find . > found
mplayer -playlist found

All times are GMT -5. The time now is 05:12 AM.