Re:Can somebody explain this? du & ls showing different sizes

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

 



>Running du -h tells that the file occupies 512M but ls -l tells that

> the file is a lot smaller. Also I am sure the the cluster size is not

>512M (or am I wrong there?).

In order to explain this behavior I did following test:

$ echo "hello" > hi.txt

$ ls -l hi.txt

-rw-r--r-- 1 user group 6 2009-02-15 18:37 download/hi.txt

(the size of the file is 6 bytes "hello" + '\n' )

$ du hi.txt

4.0K hi.txt

(the size of the block -cluster is a MicroSoft equivalent term- is 4.0K)

That explains almost all. (Some data may be in memory in disk cache and can be some asynchrony with the file system)

FN

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux