I have several thousand numbered photos on my Linux machine with filenames of the form IMG_1234.jpg. Sometimes I want to copy some of them using the command line.
Suppose I want to copy images IMG_1000.jpg through IMG_1056.jpg to a new directory. Is there a one-line command I could use to do this?
I'm not too familiar with piping and I/O redirection, or with things like grep or sed, but I have been able to obtain a list of filenames for images IMG_1000.jpg through IMG_1099.jpg using:
$ ls | grep IMG_10..\.jpg > images.txt
I was thinking that I might somehow pipe the output of the grep command to cp, but I can't figure out how to get cp to recognize the input.
2007-10-20
08:21:08
·
2 answers
·
asked by
mdd4696
3
in
Computers & Internet
➔ Software