Set Sed

How do I copy a set of numbered files on the Linux command line?
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.
An * is a wildcard for “anything”. A ? is a wildcard for “1 character” so the easiest answer would be
cp IMG_10??.jpg /target/dir
You can also replace any of the ? with a braced range such as
[2-5] for two thru five so your initial request of 1000 to 1056 could be done as
cp IMG_10[0-5]?.jpg /target/dir
|
|
DeLonghi DD50P 50 Pt. Energy Star Dehumidifier with Patented Pump $364.00 DELONGHI DD50P ENERGY STAR® DEHUMIDIFIER (50 PINT; PATENTED PUMP)… |
|
|
200 Seeds, Mugwort (Artemisia vulgaris) Seeds by Seed Needs $1.99 Grows into a big bush the first year, flowers late summer. Medicinal: Leaves are a balancing tonic for menstrual and menopausal problems…. |
|
|
Disney Fairies TinkerBell Whimsy Tink Twin Sheet Set Tinker Bell Sheets $26.25 Disney Tinkerbell Twin Sheet… |
|
|
Rockin Down the Highway $12.83 The uncharitable will say that the only thing missing from this 2 CD ’96 live set of Doobie standards is the toe tag. We merely report that several thousand boomers and bikers will enjoy it, and the cause (wildlife preservation) is a good one. –Jeff Bateman … |
|
|
Hommage à Teresa Berganza (Box Set) $44.08 … |
|
|
MIGUEL PLASCENCIA / SET YOU FREE B/W BRIGHTER DAYS… |
|
|
Turbo Snake Drain Opener $5.98 3 Piece, Turbo Snake Set, Includes: Sink Snake, Shower & Tub Snake & Storage Hook, Slow Drains, Fixed Fast, No More Chemical Drain Cleaners, Instantly Clears Slow Moving Drains, Flexible Design No Need To Remove Drain Stopper, For Bathroom Sinks, Showers & Tubs, Pitchman Approved, Featured By Anthony Sullivan From “Pitchmen” On The Discovery Channel, As Seen On TV…. |
|
|
BR Tools Screw Extractor Set – 12 Pieces $4.99 Matching drill bits are made from high speed steel. Multi-fluted extractors are made from high carbon steel…. |
|
|
Xenon White Light Bulbs 00 01 02 03 04 Audi Tt H7 (Set of 2) $8.99 NO wires will need to change More Visibility when driving at night Give The Looks Of Headlight Just Like The Luxury Cars Direct upgrade replacement of stock headlight bulbs Easy Installation (Just plug and play) No Modification needed… |
|
|
Futurama, Vol. 1 $12.98 Set in the year 3000, Futurama is the acme of sci-fi animated sitcom from Simpsons creator Matt Groening. While not as universally popular as The Simpsons, Futurama is equally hip and hilarious, thanks to its zippy lateral-thinking contemporary pop cultural references, celebrity appearances (Pamela Anderson and Leonard Nimoy are among a number of guest stars to appear as disembodied heads in … |
|
|
IBM ServeRAID M1015 SAS RAID Controller – Serial Attached SCSI, Serial ATA/600 – PCI Express x8 – Plug-in Card – 0, 1, 10 RAID Level $299 The ServeRAID M1015 SAS/SATA Controller for IBM System x is an entry-level 6 Gbps SAS 2.0 PCI Express 2.0 RAID controller. The adapter has two internal mini-SAS connectors to drive up to 32 devices and supports the same base RAID 0, 1, and 10 feature set and drivers as the M5000 series controllers. With the attachment of the ServeRAID M1000 Advanced Feature Key, the ServeRAID M1015 offers the option of RAID 5 and SED Encryption Key management, while still being sensitive to administrator cost concerns in an entry-level RAID environment. |
|
|
Phobos $0.01 Praise for Phobos: Drago’s exceptionally well-written first novel is a police procedural set on Mars in the twenty-second century. Once the investigation gets going, plot, pacing, and characters blend well. And suspense rapidly builds as we realize that some of the plots afoot threaten death tolls that make the ambitions of the terrorists Brogue foils early on seem mild. More, if you please, Mr. Drago. — Booklist Phobos is a very impressive debut novel. –Mike Resnick Set on 22nd-century Mars and the larger of its two moons, Phobos, Drago’s first novel successfully combines hard science (biotech and nanotech) with military and social SF. The SED corporation, which mines a vital metal christened barsoomium, calls the shots on the colonized Red Planet. When Lieutenant Michael Brogue, the only native Martian colonist in the Peacekeepers, rescues a visiting Terran politician from terrorists, he discovers that no good deed goes unpunished. He gets transferred to Phobos, where he replaces the moon’s popular Peacekeeper officer recently killed by a mysterious life form known as the Phobos Beast. He also encounters the formidable Sergeant Choi Min Lau and the equally formidable Wilber Isaacs and his daughter Gabrielle, entrepreneurs running the Agraria research station on Phobos. Tracking down the Phobos Beast tangles Brogue in a web of intrigue involving near-mutiny, kidnapping and murder. The author hardly sets a foot or a word wrong. This is a strong candidate for the year’s best SF debut. –Publishers Weekly A speedy pace and lots of action scenes make this a good choice for readers of sf adventure and intrigue. –Library Journal Military murder-mystery set onPhobos, one of the hurtling moons of Barsoom-er, Mars. An intriguing whodunit with well-developed characters whose mostly stock situations Drago handles with flair and skill: a newcomer worth keeping an eyestalk canted towards. –Kirkus Reviews A well-written story in a well-though |
This entry was posted on Wednesday, January 25th, 2012 at 10:18 pm and is filed under Aquariums. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.