|
|
a good sucktion script
|
|
|
|
Fresh-Faced Recruit
Join Date: Sep 2003
Status:
Offline
|
|
I'll like to suck all of my jpgs from a imported iphoto library with multible folders to one clean folder. I tried to navigate to my iphoto lib folder and type this in terminal :
cp *.jpg -r /dokuments
That somehow didn't work.
BTW..
Could you recormend a good way to organise 3 home computers iphoto libs that would like to be recentble synced?
sorry 2 ifferent quistions but you shell guuys a clever than most...
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
Originally posted by pisosse:
I'll like to suck all of my jpgs from a imported iphoto library with multible folders to one clean folder. I tried to navigate to my iphoto lib folder and type this in terminal :
cp *.jpg -r /dokuments
That somehow didn't work.
BTW..
Could you recormend a good way to organise 3 home computers iphoto libs that would like to be recentble synced?
sorry 2 ifferent quistions but you shell guuys a clever than most...
You should use `foreach'
This should work, I hope I don't make mistakes, so...
foreach i (`ls *.jpg`)
cp "$i" "~/Documents/$i"
end
That should do it.
The spaces my be tricky though. Test it and let me know.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by VEGAN:
You should use `foreach'
This should work, I hope I don't make mistakes, so...
um. perhaps i'm missing the obvious, but what's wrong with using "cp -r *.jpg /destination"?
seems to me pisosse had it right the first time, except for the position of the "-r"...
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Nov 2003
Location: Minnesota
Status:
Offline
|
|
Originally posted by rkt:
um. perhaps i'm missing the obvious, but what's wrong with using "cp -r *.jpg /destination"?
seems to me pisosse had it right the first time, except for the position of the "-r"...
You are telling it to recurse on *.jpg when you want to tell it to recursively find all .jpg files in the folders. Basically, it thinks it should do the command on everything in the current folder named *.jpg, and then to do it on everything under any folders named *.jpg.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Sep 2003
Status:
Offline
|
|
hmmm thanks guys i'll try them out
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by Turias:
Basically, it thinks it should do the command on everything in the current folder named *.jpg, and then to do it on everything under any folders named *.jpg.
yeah... umm... isn't that what he wants to do? to find all .jpg files, and copy them into a single place?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Nov 2003
Location: Minnesota
Status:
Offline
|
|
Originally posted by rkt:
yeah... umm... isn't that what he wants to do? to find all .jpg files, and copy them into a single place?
Hmm... My wording was confusing. Let me try again.
Running 'cp -r *.jpg dest/' tells your shell to do the following:
1) foreach item in current directory that matches *.jpg, copy that file to dest/
2) now recurse through any directories that match *.jpg, and repeat.
Note how this doesn't actually recurse at all, unless you happen do have a directory called something.jpg in your current location.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by Turias:
Hmm... My wording was confusing. Let me try again.
true, true. you're right, i blipped on this one...
by way of penance, i offer:
find ~/Source -name "*.jpg" -exec cp {} ~/Destination \;
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Sep 2000
Location: New Jersey, USA
Status:
Offline
|
|
Or you could just open a finder window, with the pictures folder selected in column view. Then just input .jpg into the search selection dialog.
Once they're found, select all and option drag them into your empty folder....
Though, I'd like to know the shell command for it as well. So any new knowledge for me in that aspect is a plus.
|
Dual 2.0 G5/2.5GB/ATI 9800 Pro | MacBook Pro 2.16 Gore Duo/2GB/ATI X1600
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|