View Full Version : [all variants] [SOLVED] command for transfering files
nothingspecial
June 15th, 2008, 04:39 AM
I have hundreds of jpeg files on my desktop. What command would I use to transfer them all into home/me/photos, removing them from home/me/Desktop at the same time. There is nothing else on my desktop btw.
Thanks in advance.
quinnten83
June 15th, 2008, 04:44 AM
probably something like
mv ~/Desktop/*.jpg ~/photos
but don't quote me on the syntax
Als i would use
cp ~/Desktop/*.jpg ~/photos
and then
mv ~/Desktop/*.jpg
Which means, copy first and then delete.
But again, don't quote me on the syntax, because I understand the essence of those commands but haven't been able to work properly with them yet.
acidsolution
June 15th, 2008, 04:51 AM
If you want to move than
mv /home/me/Desktop/*.jpg ../photos/
wormser
June 15th, 2008, 04:53 AM
mv ~/Desktop/*.jpg ~/photos.
That looks right to me.
nothingspecial
June 15th, 2008, 04:59 AM
cp ~/Desktop/*.jpg ~/photos
This moved them thankyou
mv ~/Desktop/*.jpg
That didn`t remove them. So I tried -
rm ~/Desktop/*.jpg
which retuned
rm: remove regular file `/home/me/Desktop/Photo-0001.jpg'?
so I pressed y so it asked me if I wanted to remove 000.2.jpg and so on, so I pressed y 121 times and they`re all gone.
I guess I have my photo`s where I want them and not where I don`t but I`d still like to know the command that does it in 1 hit.
Kronie
June 15th, 2008, 05:17 AM
or, you could just select'em all, ctrl+x and then ctrl+v in ~/photos :P
quinnten83
June 15th, 2008, 05:29 AM
according to man remove
rm -f would have done the trick.
you would not have been prompted.
StooJ
June 15th, 2008, 05:53 AM
acidsolution's command would have been the one click wonder. So would quinnten83's first command. They are both pretty much the same. I personally prefer quinnten83's solution because copying and pasting the command would work. (Rereading the OP I notice that acidsolution's command was perfect for C&Ping too, if your username is indeed me
mv ~/Desktop/*.jpg ~/photos
mv is move files (or think of it as a "copy files then delete the originals")
~ is a nice shortcut to the current user's home directory. If you compare quinnten83's command to acidsolution's command:
quinnten83: mv ~/Desktop/*.jpg ~/photos
acidsolution: mv /home/me/Desktop/*.jpg ../photos/
acidsolution's example relies on your user name being "me". Obviously you would replace this with your user name, perhaps : /home/nothingspecial/Desktop
quinnten83 uses the tilda, so the command understands it as being /home/nothingspecial/Desktop automatically. If I had a user account on your computer, I would type ~/Desktop and it would resolve to /home/stooj/Desktop
I'm sure you're probably familiar with wildcards, but just in case:
* means "anything". I'll use the ls command in these examples, ls lists the contents of a directory.
ls * will list all the files in the current directory
ls P* will list all the files starting with the letter P in the current directory.
ls *.jpg will list all the files with a jpg extension (any file, as long as it's a jpg picture)
So, back to quinnten83's command.
mv ~/Desktop/*.jpg ~/photos
Move all the jpg pictures on my personal desktop into my personal photos folder.
I hope this helps
nothingspecial
June 19th, 2008, 07:18 AM
Forgot to mark this solved - sorry.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.