Copying numerical range of folders

Ulf Rompe Ulf.Rompe at icem.com
Fri Jan 23 12:07:50 UTC 2009


Am Donnerstag, den 22.01.2009, 22:37 +0000 schrieb Oliver Marshall:
> Sudo cp /folder/k8[100-945] /folder2 blah blah
> 
>  
> 
> But that tells me there are no folders called k8[100-945]. However the
> following does work;
> 
>  
> 
> Sudo cp /folder/k810[0-9] /folder2 blah blah

Try sequences instead of character groups. Bash has built in support for
sequences:

sudo cp /folder/k8{100..945} /folder2/

[x] ulf
-- 
"I heard if you play the Windows-XP-CD backwards, you get a satanic message."
"That's nothing, if you play it forward, it installs Windows XP"





More information about the ubuntu-users mailing list