last day (20 days later) » 

9:54 PM
4
A: I want shotwell to open all .cr2 files in a folder and all its subfolders, what command line do I use?

ZannaYou could use find, which automatically searches subdirectories recursively find -type f -iname '*.cr2' -exec shotwell '{}' + As pointed out by Eliah Kagan in this comment if you use the conventional \; to terminate the command, it launches an instance of shotwell once for each file. Using + w...

 
why does this also open .jpg and .png files in the directory? I see that it specifies *.cr2? How do I get it to just look at .cr2 files when I push the left arrow on shotwell? If I use a \ instead of a +, nothing happens :(
 
oh! this is a problem @user285884 I'm sorry, shotwell cycles through all the images it finds in the directory... let me see if I can figure out a way around it...
@user285884 edited, but I can't work out an elegant solution :(
 
ok, thanks for the effort! what about this, I search through the directory for .cr2 files and move them into a separate folder call cr2files. I've done it within one subfolder by using mv *.cr2 ../cr2files/ and it worked!. However, how do I do this and specify which files to look into? Something like "hey linux look at folders 1-10 for .cr2 files and move it into the cr2files folder"? Thanks Zanna
 
@user285884 I recommend using find for that job - I just edited my command a little bit, but you need to correct the path for your cr2files directory if it's not in the top level of your home directory. For example if the path is /home/username/photos/cr2files then the command would have ~/photos/cr2files. Does this help or am I missing the point?
 
well for some context on where I am. I lost a few pictures. So I did a photorec and it gave me a boatload of folders, enough to fill up my entire hard drive. So I want to look in all the folders in my hard drive except for one because that one has a ton of .cr2 files that I know are not the one I'm looking for. So I want linux to go through all of the folders except for one. I'm not sure your code does that. What does {} do? Also the "--" after the -v? Thanks Zanna!
 
9:54 PM
ah @user285884 please see my edit - you can easily exclude a directory from find
 
For some reason it doesn't do anything I just get ">" and a cursor. Perhaps there are so many files to go through? but doesn't -v mean it will tell me what it is doing?
 
yes -v means it will tell you what it is doing. > in the terminal means the command is unterminated. Let's figure out what is going wrong :) Please paste the command you are using
 
10:09 PM
Hi! great
find -type f -iname '.cr2' -not Photogs/ './dir/*/' -exec mv -v -- '{}' cr2files/ \
btw also my hard drive is literally filled all the way up, so it's acting a little wonky too
 
what's the path of the directory you want to exclude?
sorry my answer is not clear enough, I need to edit again...
 
/media/pete/Linux hard drive/Photogs would be the path. But I am in Linux hard drive so I just put in Photogs/
 
hmm to clarify please could you run find -name "Photogs" and paste the output?
 
./Photogs
 
ok it's clear :)
so the command should be
find -type f -iname '*.cr2' -not -path './Photogs/*' -exec mv -v -- '{}' cr2files \;
 
10:19 PM
nice! it worked! woo hoo!
 
awesome. I will edit my answer now :)
does that fix your whole problem?
 
it couldn't transfer all the files because there was "no space left on device"...I thought moving doesn't require adding more space
 
mv copies the file then deletes the old file, so it does take a little bit of extra space
anything on there you can delete?
 
Yeah that's what I'm going to do
just curious, do you work for ubuntu?
also, what does the -- after -v do?
 
no I just hang out here :)
I added an explanation for -- in my answer - was it unclear?
 
10:24 PM
lol nice, I'm impressed by the community. I see it, it is clear, thanks!
 
now I edited my answer with a more complete explanation
it's great to hear we are making a good impression haha :)
 
Thanks Zanna!
 
it's a pleasure... I'm just wondering if we should edit your question with the details of exactly what you were trying to do based on your comments on my answer
 
Oh you mean talk about the missing photos and the hard drive etc.?
 
yeah... it should be in the question imho, you should always try to ask about your real problem with context to get the answer you really need (otherwise it takes 20 comments haha)
 
10:32 PM
haha true. I just created this account so this is the first question I've asked in a while
 
anyway we can edit your question, but I am going to ping Eliah because he spent so much time and effort on his answer
 
ok, I'm on it
 
ok :) Do you need some more help or do you consider it fixed? Bedtime for me if you are done
 
I wilI will be ok, goodnight!
 
goodnight :)
 
11:10 PM
OH my... how did I get in this room :p
 

  last day (20 days later) »