Skip to main content
13 events
when toggle format what by license comment
Jun 25, 2022 at 10:32 comment added Kusalananda @LewisChan I believe this partly depends on what filesystem you're using. You may want to ask a new question about this (and provide more information when doing so).
Jun 25, 2022 at 9:31 comment added Lewis Chan @Kusalananda I create a file with fallocate -l 1M file, ls -h file shows 1M, du -h file shows 1M too. Why doesn't du -h file show zero ?
Mar 21, 2021 at 19:28 history edited Kusalananda CC BY-SA 4.0
added 6 characters in body
Mar 14, 2019 at 13:27 comment added Kusalananda @SergiyKolodyazhnyy (sorry to reply late) No, du shows the amount of disk actually in use by the file, while the apparent size (logical size) shown by ls is how many bytes a program would be able to read from it. If the file is sparse, some of the read bytes would be zeroes, but they would still be delivered to the program that read them (just not from disk).
Mar 14, 2019 at 11:41 history edited Kusalananda CC BY-SA 4.0
added 17 characters in body
Jan 15, 2019 at 23:46 comment added Sergiy Kolodyazhnyy Correct me if I misunderstand something, but it appears the first sentence is the other way around: stackoverflow.com/a/31437673/3701431 du would show how much data can be actually read, while ls shows the extent to which disk sectors are allocated.
Apr 8, 2018 at 13:20 history edited Kusalananda CC BY-SA 3.0
added 2 characters in body
Apr 8, 2018 at 12:49 vote accept user285003
Apr 8, 2018 at 12:48 vote accept user285003
Apr 8, 2018 at 12:48
Apr 8, 2018 at 10:24 history edited Kusalananda CC BY-SA 3.0
added 84 characters in body
Apr 8, 2018 at 10:10 history edited Kusalananda CC BY-SA 3.0
added 433 characters in body
Apr 8, 2018 at 9:52 history edited Kusalananda CC BY-SA 3.0
added 127 characters in body
Apr 8, 2018 at 9:36 history answered Kusalananda CC BY-SA 3.0