[clug] Shell glob for a range of numbers?

Martin Pool mbp at sourcefrog.net
Thu Jan 8 11:31:42 GMT 2004


On Thu, 08 Jan 2004 17:57:45 +1100
Damien Elmes <clug at repose.cx> wrote:

> > seq 5 21 | sed 's/^/argus.log./' | xargs cp --target-directory=/tmp

You forgot the .gz.  --target-directory is cute.  Perhaps better

seq 5 21 | xargs cp argus.log.{}.gz /tmp

This does invoke multiple cp commands.  So perhaps

cp `seq -f 'argus.log.%g.gz' 5 21` /tmp

--
Martin


More information about the linux mailing list