Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-09-2004, 10:53 AM
|
#1
|
Member
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54
Rep:
|
error with find . | xargs
arrrghh !!!
I want to play all movies in all SUBdirectories of the current one.
So I tried :
Code:
find . | xargs mplayer
but it says (in french, although it's almost not understandable) :
Code:
xargs: Le paramètre simple n'est pas repérable par apostrophe.
which would approximately be (in english) :
Code:
xargs: The (bare?|simple?|unique?) parameter is not (locatable?) with quotes.
What did I make wrong ?
I also tried :
Code:
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) :
Code:
.
./dos
./dos/complet
./dos/complet/sweden-back-front.mpg
./dos/complet/jennie-50m-side2.mpg
./dos/complet/jennie-start.mpg
./dos/complet/laurentino.mpg
./dos/complet/oliveirapedro.mpg
./dos/complet/jennie-25m-side.mpg
./dos/complet/sweden-turn2-side.mpg
./dos/complet/jennie-front.mpg
./dos/complet/JensPetterson2.mpg
./dos/complet/JensPetterson3.mpg
./dos/complet/JensPetterson4.mpg
./dos/complet/JensPetterson5.mpg
./dos/backswim-men-stroke-side.mpg
./dos/Peirsol-stroke.mpg
./dos/Phelps-backstroke-under.mpg
./dos/lenny1.mpeg
./dos/lenny2.mpeg
./dos/MbackPiersolRecovery.mpeg
./dos/lenny3.mpeg
./dos/Peirsol-finishing.mpg
./dos/backstroke_07.jpg
./dos/Backswim-kayaking.mpg
./dos/Nina-golden-touch.mpg
./dos/Backstroke-SwimcityMediaCentre-NakamuraSilver&MocanuGoldOR100mSydney2000.mpg
./dos/welsh-bodyroll.mpg
./dos/depart
./dos/depart/backstart-men-good position.mpg
./dos/depart/Welsh-front.mpg
...
./brasse/Russian-women-breast-wide-knees-inward-sweep.mpg
./brasse/Poleska-style.mpg
./divers
./divers/Video-TestingTrolley.mpg
./divers/Story_400x320.mpg
Last edited by cbonar; 12-09-2004 at 11:20 AM.
|
|
|
12-09-2004, 10:58 AM
|
#2
|
Member
Registered: Dec 2004
Distribution: gentoo
Posts: 190
Rep:
|
Maybe you want to try somthing like this? :
Code:
prompt> find . -name "*word_you_are_looking_for_here*" -print
or maybe even:
Code:
prompt> find . | grep word_you_are_looking_for_here
Hope that helps!
|
|
|
12-09-2004, 11:02 AM
|
#3
|
Member
Registered: Dec 2004
Distribution: gentoo
Posts: 190
Rep:
|
Gosh, I'm sorry. I didn't even read all of your post.
I use mplayer to play all my movies like so:
Code:
prompt> mplayer *.mpeg *.avi *.mpg
It should be that simple. I do use extra options, so my actual line is more like:
Code:
prompt> mplayer -fs -loop 0 *.mpeg *.avi *.mpg
(great for pr0n...)
|
|
|
12-09-2004, 11:09 AM
|
#4
|
Member
Registered: Dec 2004
Distribution: gentoo
Posts: 190
Rep:
|
Gee, I don't know what's wrong with me today. I misread your post _twice_.
Try this:
Code:
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...
|
|
|
12-09-2004, 11:18 AM
|
#5
|
Member
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54
Original Poster
Rep:
|
Thanks for you 3 posts !!! LOL
but
Code:
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...
|
|
|
12-09-2004, 11:22 AM
|
#6
|
Member
Registered: Dec 2004
Distribution: gentoo
Posts: 190
Rep:
|
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:
Code:
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?
|
|
|
12-09-2004, 12:08 PM
|
#7
|
Member
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54
Original Poster
Rep:
|
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...
Last edited by cbonar; 12-09-2004 at 12:30 PM.
|
|
|
12-09-2004, 12:22 PM
|
#8
|
Member
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54
Original Poster
Rep:
|
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.
Code:
find . > found
mplayer -playlist found
|
|
|
All times are GMT -5. The time now is 08:13 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|