"ls" sorts wrongly if given large number of files

Eliot Moss moss@cs.umass.edu
Wed Jan 6 18:45:55 GMT 2021


Here's a wondering ...

In Linux, and I suspect Cygwin, etc., as well, there are two notions of
"size".  One is the amount fo storage the file consumes.  The other is the
position just after the last byte in the file.  These can be different because
of _holes_ in the middle of files.  17M for a setup.ini file sounds
suspiciously large.  I wonder if that file has a hole in it?

Try:

ls -os --block-size=1

(See https://unix.stackexchange.com/questions/436314/how-to-get-the-physical-size-of-a-file-in-linux.)

Regards - Eliot Moss


More information about the Cygwin mailing list