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

Re: A du puzzle





Tom Hansen wrote:
Why is it that

  du -x | grep "^[^/]*/[^/]*$"

is much faster than

  du -sx *

??


In what order did you execute the commands? Might be that the info was still in memory. Just look at the timed sequence below.

Kind regards,

Herta

# time du -x | grep "^[^/]*/[^/]*$"
(...)
real    1m11.196s
user    0m1.544s
sys     0m4.988s

# time du -sx *
(...)
real    0m1.482s
user    0m0.312s
sys     0m1.048s

# time du -x | grep "^[^/]*/[^/]*$"
(...)
real    0m1.845s
user    0m0.592s
sys     0m1.084s

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



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