[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp oddity

From: Pádraig Brady
Subject: Re: cp oddity
Date: Thu, 16 Apr 2009 13:27:40 +0100
User-agent: Thunderbird (X11/20071008)

Adrian Revill wrote:
> Hi,
> I am not sure if this is a bug, but would appreciate some advise.
> If i use a single cp to copy multiple files, then read the files in
> inode order. I see faster disk access times than if i copy each file
> individually.
> cp -a /data/A /test/
> cp /data/A/* /test/B
> for f in `ls -U /data/A`; do cp /test/A/$f /test/C; done
> for f in `ls /data/A`; do cp /test/A/$f /test/D; done
> cp /test/D/* /test/E

For C and D you're using shell looping and starting a
cp process for each file which are both slow.
Instead try:

ls -U /data/A | xargs cp -t /test/C


reply via email to

[Prev in Thread] Current Thread [Next in Thread]