You are not logged in.

#1 2009-06-13 02:43:26

arunix
Member
From: /home/kurali
Registered: 2009-04-08
Posts: 93

Copy Files

Hello All :-)
i m here with a new problem.
i have a digital cam[sony] it can strore upto 1500 pics. i want to copy them on machine not all. i copy a range of files[pics] that is between 1250 t0 1425 [these are the name in the digital cam like sac1250.jpg to sac1425.jpg]. i dont know how to copy a particaular range at once.
i have two option
1.) first cp *.*  but is time and storage conusming process.
2.) second cp <filename>,<filename1>,<filename-n>

what to do next?.

Thanks:)


Minds are like parachutes. They only function when they are open.

Offline

#2 2009-06-13 02:53:03

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Copy Files

Probably need to use regular expressions in a shell script. Sorry I can't help with either of those.


neutral

Offline

#3 2009-06-13 02:57:09

arunix
Member
From: /home/kurali
Registered: 2009-04-08
Posts: 93

Re: Copy Files

Dear I dont know anything about it.


Minds are like parachutes. They only function when they are open.

Offline

#4 2009-06-13 03:11:49

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Copy Files

Small script:

for NUM in `seq 1250 1425` ; do
   cp sac$NUM.jpg /path/to/destination
done

I don't know any a way to do it with Bash globbing.

Last edited by fukawi2 (2009-06-13 03:12:52)

Offline

#5 2009-06-13 04:52:21

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: Copy Files

Hello arunix, As linux offers many DE in my case with GNOME, using gpicview / mirage I could transfer all the photos from sony DSC P72 without any problem. As others said to get only the selected range use  bash script or wiith the graphical interface you can do it easily.

Offline

#6 2009-06-13 08:17:01

arunix
Member
From: /home/kurali
Registered: 2009-04-08
Posts: 93

Re: Copy Files

Thanks Dear For Reply me :-)
Now i am searching for shell-script.


Minds are like parachutes. They only function when they are open.

Offline

#7 2009-06-13 08:31:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Copy Files

arunix wrote:

Now i am searching for shell-script.

The script I posted above will do what you want...

Last edited by fukawi2 (2009-06-13 08:32:06)

Offline

#8 2009-06-13 08:39:00

arunix
Member
From: /home/kurali
Registered: 2009-04-08
Posts: 93

Re: Copy Files

Thanks dera what i will start shell-scriot for furthure use ......
and many more work.......


Minds are like parachutes. They only function when they are open.

Offline

#9 2009-06-13 11:34:31

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Copy Files

bash can do number ranges with {i..n}, ex:

$ echo sac{1250..1255}.jpg
sac1250.jpg sac1251.jpg sac1252.jpg sac1253.jpg sac1254.jpg sac1255.jpg

Offline

#10 2009-06-13 12:26:21

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Copy Files

fukawi2 wrote:

The script I posted above will do what you want...

Did someone say something? I thought I heard something... and what's that awful smell? Did someone let a monkey in here?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#11 2009-06-13 22:46:43

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Copy Files

peets wrote:

bash can do number ranges with {i..n}, ex:

$ echo sac{1250..1255}.jpg
sac1250.jpg sac1251.jpg sac1252.jpg sac1253.jpg sac1254.jpg sac1255.jpg

Sweet! Bash can do it... It seemed like such a simple thing that it should be able to do it, but I've never been able to find that. Thanks peets big_smile

Offline

Board footer

Powered by FluxBB