Active Topics

 


Reply
Thread Tools
Posts: 74 | Thanked: 15 times | Joined on Feb 2008
#11
OK I give up... I can't get the files off for love or money. For the flash drive I did:
cp /root/*.txt /media/usb/sda1/*.txt but that doesn't seem to work - anyone see anything obviously wrong? I can see them on the flash but when I put it in my laptop to send them here, I don't see them. Also I can't seem to unmount the flash....

Is there a way of moving files with putty? It doesn't seem obvious to me...

TIA

C
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#12
Yes. That doesn't work, because * expands to match any filenames there.

So, if you have a.txt, b.txt, and c.txt in /root/, and have 1.txt and 2.txt already on /media/usb/sda1/, it expands to:
Code:
cp /root/a.txt /root/b.txt /root/c.txt /media/usb/sda1/1.txt /media/usb/sda1/2.txt
Which doesn't work; cp takes either exactly two arguments of which the first is a file, and the second is the path and name for the copy of the file, or takes more than two arguments, in which case all but the last are files, and the last is a (pre-existing) directory to copy all the files into, each with their own name.

So you'd just want:
Code:
cp /root/*.txt /media/usb/sda1/
Which expands to:
Code:
cp /root/a.txt /root/b.txt /root/c.txt /media/usb/sda1/
Which is exactly what you want.

Last edited by Benson; 2008-07-25 at 13:14. Reason: Just realized I missed some colors. :o
 

The Following 2 Users Say Thank You to Benson For This Useful Post:
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#13
Oh, and there is a command that does something close to what you were trying; mcp (and mmv for mv...), but it's not on the tablets by default. But for it to interpret the globs right, you have to quote or escape them from the shell, so:
Code:
mcp '/root/*.txt' '/media/usb/sda1/#1.txt'
That's useful, for example, in renaming *.htm <-> *.html, fixing uppercase, and the like.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:19.