Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with "du -hs" showing a wrong file size for about 1 minute. for example: downloading 200MB file, and checking with du right after the download has been completed will show 1.1MB. than after about 60 seconds it will show the correct size.

share|improve this question
1  
That sounds weird.. Unless the machine is still committing to disk when you 1st run du. Try running "sync;du -sh" ? It might be that if you're downloading via a browser, it saves it to a temp file first of all then when completed, copies it to the correctly named file? Try doing an "ls -lrt" in the download directory to see which files are updated last (most recent at the end of the listing). – FreudianSlip Jan 20 '13 at 8:38
    
sync;du -sh helped, thanks! won't it hurt server performance? – teslasimus Jan 20 '13 at 8:47
    
negligibly - the server will do a sync every X seconds anyway. – FreudianSlip Jan 21 '13 at 16:25
    
If this solves your problem, post it as an answer. – Scott Jan 22 '13 at 2:18

You must log in to answer this question.

Browse other questions tagged .