Home » Questions » Computers [ Ask a new question ]

Why ls and du show different size?

Why ls and du show different size?

I am downloading a file with rtorrent,

Asked by: Guest | Views: 373
Total answers/comments: 1
Guest [Entry]

"It's a sparse file. ls is reporting the allocated size; du is reporting the amount of space actually used.

As your torrent client downloads more it will fill in the gaps and the du-reported size will grow to match what ls reports.

To force du and df to include sparces, from the man du the second option listed is --apparent-size:

du -s -B1 --apparent-size"