"ls" sorts wrongly if given large number of files

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

"ls" sorts wrongly if given large number of files

Cygwin list mailing list
Hi all

"ls" (version 8.26) sorts wrongly if given large number of files via
"find" or "xargs"

For example:

find -type f -exec ls -oS -h {} +

OR

find -type f -print0 | xargs -0r ls -oS -h

Gives following data. Sorry for the long listing, and wrapped lines. But
search for "setup.ini" which is about 17 MB, it is sorted AFTER very
small files.

In fact it seams that sorting is restarted from that file (subsequent
files are again sorted). Note also that removing "-h" from "ls" command
lines results in the same problem.

(output is trimmed to remove unnecessary data, i.e.
perms/user/date-time, but order is the same)

  26M ./release/gcc/gcc-core/gcc-core-10.2.0-1.tar.xz
  24M ./release/binutils/binutils-2.34+1git.de9c1b7cfe-1.tar.xz
  17M ./release/llvm/libllvm8/libllvm8-8.0.1-1.tar.xz
  15M ./release/gcc/gcc-g++/gcc-g++-10.2.0-1.tar.xz
  11M ./release/ghostscript/ghostscript-9.10-1.tar.bz2
9.2M ./release/clang/libclang5.0/libclang5.0-5.0.1-2.tar.xz
9.1M ./release/llvm/libllvm3.7/libllvm3.7-3.7.1-2.tar.xz
9.1M ./release/llvm/libllvm5.0/libllvm5.0-5.0.1-1.tar.xz
8.9M ./release/gcc/gcc-fortran/gcc-fortran-10.2.0-1.tar.xz
7.9M ./release/gtk3/libgtk3_0/libgtk3_0-3.22.28-1.tar.xz
7.5M ./release/icu/libicu61/libicu61-61.1-1.tar.xz
6.2M ./release/clang/libclang3.7/libclang3.7-3.7.1-1.tar.xz
6.2M ./release/lcms2/lcms2-2.9-1.tar.xz
6.1M ./release/font-adobe-dpi100/font-adobe-dpi100-1.0.2-1.tar.bz2
5.9M ./release/python/python-2.7.10-1.tar.xz
5.7M ./release/python37/python37-3.7.7-1.tar.xz
5.6M ./release/python36/python36-3.6.10-1.tar.xz
5.4M ./release/font-adobe-dpi75/font-adobe-dpi75-1.0.2-1.tar.bz2
4.8M ./release/guile2.2/libguile2.2_1/libguile2.2_1-2.2.7-1.tar.xz
4.8M ./release/guile/libguile2.2_1/libguile2.2_1-2.2.4-1.tar.xz
4.6M ./release/llvm/libllvm3.4/libllvm3.4-3.4.2-5.tar.xz
4.4M ./release/pl/pl-7.2.3-1.tar.xz
4.3M ./release/lapack/liblapack-devel/liblapack-devel-3.9.0-2.tar.xz
4.3M ./release/python2/python27/python27-2.7.18-1.tar.xz
4.1M ./release/gtk2.0/libgtk2.0_0/libgtk2.0_0-2.24.32-1.tar.xz
4.0M ./release/graphviz/graphviz-2.40.1-5.tar.xz
3.8M ./release/perl/perl-5.30.3-1.tar.xz
3.6M ./release/font-misc-misc/font-misc-misc-1.1.1-1.tar.bz2
3.3M ./release/gdb/gdb-9.2-1.tar.xz
3.1M ./release/ruby/ruby-2.6.4-1.tar.xz
3.1M ./release/perl/perl_base/perl_base-5.30.3-1.tar.xz
3.0M ./release/glib2.0/libglib2.0_0/libglib2.0_0-2.54.3-1.tar.xz
2.8M ./release/groff/groff-1.22.4-1.tar.xz
2.6M ./release/coreutils/coreutils-8.26-2.tar.xz
2.5M ./release/mesa/dri-drivers/dri-drivers-19.1.6-1.tar.xz
2.1M ./release/ghostscript/libgs9/libgs9-9.53.3-1.tar.xz
2.0M ./release/cygwin/cygwin-3.1.7-1.tar.xz
1.9M ./release/lapack/liblapack0/liblapack0-3.9.0-2.tar.xz
1.9M ./release/libX11/libX11-doc/libX11-doc-1.7.0-1.tar.xz
1.7M ./release/libcxx/libc++-devel/libc++-devel-8.0.1-1.tar.xz
1.7M ./release/lynx/lynx-2.8.7-1.tar.bz2
1.7M ./release/mc/mc-4.8.25-1.tar.xz
1.6M ./release/cygwin/cygwin-doc/cygwin-doc-3.1.7-1.tar.xz
1.6M ./release/php/php-7.3.7-2.tar.xz
1.5M ./release/bash/bash-4.4.12-3.tar.xz
1.5M ./release/guile/guile-2.2.4-1.tar.xz
1.5M ./release/python-gtk2.0/python-gtk2.0-2.24.0-2.tar.bz2
1.5M ./release/tcl/tcl-8.6.8-1.tar.xz
1.3M ./release/mpfr/libmpfr6/libmpfr6-4.1.0-1.tar.xz
1.3M ./release/splint/splint-3.1.2-1.tar.bz2
1.1M ./release/openssl10/libssl1.0/libssl1.0-1.0.2t-1.tar.xz
1.1M ./release/gnupg/gnupg-1.4.23-1.tar.xz
1.1M ./release/openssl/libssl1.1/libssl1.1-1.1.1f-1.tar.xz
1.1M ./release/gawk/gawk-5.1.0-1.tar.xz
1.1M ./release/nss/libnss3/libnss3-3.45-1.tar.xz
943K ./release/openssl/libopenssl100/libopenssl100-1.0.2p-1.tar.xz
899K ./release/tar/tar-1.32-2.tar.xz
890K ./release/db/libdb5.3/libdb5.3-5.3.28-2.tar.xz
873K ./release/openssh/openssh-8.4p1-2.tar.xz
828K ./release/texinfo/texinfo-6.7-1.tar.xz
826K ./release/glu/glu-debuginfo/glu-debuginfo-9.0.1-1.tar.xz
821K ./release/python-lxml/python3-lxml/python3-lxml-3.7.3-1.tar.xz
803K ./release/python-lxml/python2-lxml/python2-lxml-3.7.3-1.tar.xz
785K ./release/man-db/man-db-2.7.6.1-1.tar.xz
772K ./release/libX11/libX11_6/libX11_6-1.7.0-1.tar.xz
766K ./release/poppler/libpoppler99/libpoppler99-0.88.0-2.tar.xz
714K ./release/libiconv/libiconv-devel/libiconv-devel-1.16-2.tar.xz
711K ./release/openssl/openssl-1.1.1f-1.tar.xz
695K ./release/libxml2/libxml2-2.9.10-2.tar.xz
689K ./release/mintty/mintty-3.4.4-1.tar.xz
665K ./release/cairo/libcairo2/libcairo2-1.16.0-1.tar.xz
657K ./release/homebank/homebank-5.0.9-1.tar.xz
641K ./release/poppler/libpoppler73/libpoppler73-0.62.0-1.tar.xz
631K ./release/graphviz/tcl-tcldot/tcl-tcldot-2.40.1-5.tar.xz
615K ./release/findutils/findutils-4.6.0-1.tar.xz
607K ./release/bison/bison-3.0.4-1.tar.xz
599K ./release/libidn/libidn-1.33-1.tar.xz
597K ./release/openssl/libopenssl098/libopenssl098-0.9.8zb-1.tar.xz
590K ./release/font-encodings/font-encodings-1.0.4-1.tar.bz2
590K ./release/openblas/libopenblas/libopenblas-0.3.12-1.tar.xz
586K ./release/file/file-5.39-1.tar.xz
581K ./release/OpenSP/libosp5/libosp5-1.5.2-2.tar.bz2
580K ./release/gcc/libgfortran5/libgfortran5-10.2.0-1.tar.xz
564K ./release/guile1.8/libguile17/libguile17-1.8.8-3.tar.xz
561K ./release/graphviz/libgvc6/libgvc6-2.40.1-5.tar.xz
548K ./release/sqlite3/libsqlite3_0/libsqlite3_0-3.32.3-1.tar.xz
538K ./release/gnutls/libgnutls30/libgnutls30-3.6.9-1.tar.xz
535K ./release/libiconv/libiconv2/libiconv2-1.16-2.tar.xz
535K ./release/libvorbis/libvorbis-1.3.6-1.tar.xz
527K ./release/isl/libisl22/libisl22-0.22.1-2.tar.xz
505K ./release/mesa/mesa-19.1.6-1.tar.xz
502K ./release/make/make-4.3-1.tar.xz
475K ./release/texinfo/info/info-6.7-1.tar.xz
470K ./release/libXt/libXt6/libXt6-1.2.0-1.tar.xz
461K ./release/isl/libisl15/libisl15-0.16.1-1.tar.xz
457K ./release/readline/readline-6.1.2-3.tar.bz2
453K ./release/libgcrypt/libgcrypt20/libgcrypt20-1.8.2-1.tar.xz
445K ./release/tcsh/tcsh-6.21.00-1.tar.xz
428K ./release/gcc/libgfortran4/libgfortran4-7.4.0-1.tar.xz
427K ./release/freetype2/libfreetype6/libfreetype6-2.10.4-2.tar.xz
424K ./release/mathomatic/mathomatic-16.0.0-1.tar.bz2
400K ./release/gcc/libstdc++6/libstdc++6-10.2.0-1.tar.xz
381K ./release/isl/libisl13/libisl13-0.14.1-1.tar.xz
370K ./release/harfbuzz/libharfbuzz0/libharfbuzz0-2.6.6-1.tar.xz
359K ./release/isl/libisl10/libisl10-0.11.1-2.tar.bz2
355K ./release/grep/grep-3.0-2.tar.xz
343K ./release/cygwin/cygwin-devel/cygwin-devel-3.1.7-1.tar.xz
341K ./release/gnutls/libgnutls28/libgnutls28-3.3.27-1.tar.xz
335K ./release/diffutils/diffutils-3.5-2.tar.xz
332K ./release/freeglut/libglut-devel/libglut-devel-3.2.1-1.tar.xz
328K ./release/flex/flex-2.6.4-2.tar.xz
321K ./release/dos2unix/dos2unix-7.4.2-1.tar.xz
307K ./release/pcre/pcre-8.43-1.tar.xz
306K ./release/fontconfig/fontconfig-2.11.1-2.tar.xz
304K ./release/libarchive/libarchive13/libarchive13-3.5.0-1.tar.xz
303K ./release/perl-XML-LibXML/perl-XML-LibXML-2.0118-1.tar.xz
297K ./release/shared-mime-info/shared-mime-info-1.8-1.tar.xz
293K ./release/procps-ng/procps-ng-3.3.16-1.tar.xz
293K ./release/libsoup2.4/libsoup2.4_1/libsoup2.4_1-2.60.3-1.tar.xz
293K ./release/ncurses/ncurses-6.1-1.20190727.tar.xz
286K ./release/sed/sed-4.4-1.tar.xz
279K ./release/csih/csih-0.9.11-1.tar.xz
279K ./release/libsndfile/libsndfile1/libsndfile1-1.0.28-2.tar.xz
271K ./release/slang/libslang2/libslang2-2.3.2-2.tar.xz
264K ./release/curl/libcurl4/libcurl4-7.74.0-1.tar.xz
249K ./release/nas/libaudio-devel/libaudio-devel-1.9.3-1.tar.bz2
247K ./release/librsvg2/librsvg2_2/librsvg2_2-2.40.20-1.tar.xz
241K ./release/libXaw/libXaw7/libXaw7-1.0.13-1.tar.xz
238K ./release/krb5/libkrb5_3/libkrb5_3-1.15.2-2.tar.xz
232K ./release/rebase/rebase-4.4.4-1.tar.xz
224K ./release/m4/m4-1.4.18-1.tar.xz
220K ./release/pixman/libpixman1_0/libpixman1_0-0.40.0-1.tar.xz
218K ./release/expect/expect-5.45-3.tar.xz
216K ./release/pango1.0/libpango1.0_0/libpango1.0_0-1.40.14-1.tar.xz
211K ./release/gmp/libgmp10/libgmp10-6.2.1-1.tar.xz
203K ./release/nas/nas-1.9.3-1.tar.bz2
199K ./release/pulseaudio/libpulse0/libpulse0-11.1-1.tar.xz
196K ./release/libxslt/libxslt-1.1.29-1.tar.xz
194K ./release/gmp/libgmp3/libgmp3-4.3.2-1.tar.bz2
193K ./release/brotli/libbrotlienc1/libbrotlienc1-1.0.9-1.tar.xz
192K ./release/flac/libFLAC8/libFLAC8-1.3.2-1.tar.xz
191K ./release/gcc/libquadmath0/libquadmath0-10.2.0-1.tar.xz
188K ./release/fbpanel/fbpanel-7.0-1.tar.xz
187K ./release/libcxx/libc++1/libc++1-8.0.1-1.tar.xz
186K ./release/gpgme/libgpgme11/libgpgme11-1.9.0-1.tar.xz
186K ./release/atk1.0/libatk1.0_0/libatk1.0_0-2.26.1-1.tar.xz
185K ./release/python-cffi/python3-cffi/python3-cffi-1.9.1-1.tar.xz
184K ./release/lua/lua-5.3.5-1.tar.xz
184K ./release/mesa/libGL-devel/libGL-devel-19.1.6-1.tar.xz
183K ./release/python-cffi/python2-cffi/python2-cffi-1.9.1-1.tar.xz
177K ./release/pcre2/libpcre2_8_0/libpcre2_8_0-10.34-1.tar.xz
176K ./release/libwebp/libwebp7/libwebp7-0.6.1-2.tar.xz
172K ./release/libthai/libthai0/libthai0-0.1.26-1.tar.xz
171K ./release/mcpp/mcpp-2.7.2-2.tar.xz
171K ./release/libpng/libpng16/libpng16-1.6.37-1.tar.xz
170K ./release/nettle/nettle-3.4.1-1.tar.xz
169K ./release/curl/curl-7.74.0-1.tar.xz
167K ./release/graphviz/liblab_gamut1/liblab_gamut1-2.40.1-5.tar.xz
161K ./release/dbus/dbus-1.10.22-1.tar.xz
161K ./release/libssh/libssh4/libssh4-0.8.7-1.tar.xz
159K ./release/gdbm/gdbm-1.18.1-1.tar.xz
153K ./release/tiff/libtiff6/libtiff6-4.2.0-1.tar.xz
150K ./release/glu/libGLU1/libGLU1-9.0.1-1.tar.xz
150K ./release/graphviz/libgvpr2/libgvpr2-2.40.1-5.tar.xz
149K ./release/p11-kit/libp11-kit0/libp11-kit0-0.23.20-1.tar.xz
148K ./release/perl-XML-Parser/perl-XML-Parser-2.44-1.tar.xz
146K ./release/pcre/libpcre1/libpcre1-8.44-1.tar.xz
146K ./release/mpfr/libmpfr4/libmpfr4-3.1.6-1p1.tar.xz
145K ./release/astyle/astyle-2.06-1.tar.xz
142K ./release/cyrus-sasl/libsasl2_3/libsasl2_3-2.1.27-1.tar.xz
140K ./release/e2fsprogs/libext2fs2/libext2fs2-1.44.5-1.tar.xz
139K ./release/libXfont2/libXfont2_2/libXfont2_2-2.0.4-1.tar.xz
139K ./release/python2/python27-devel/python27-devel-2.7.18-1.tar.xz
138K ./release/libjpeg-turbo/jpeg/jpeg-1.3.1-1.tar.xz
137K ./release/libXfont/libXfont1/libXfont1-1.5.4-1.tar.xz
135K ./release/cgdb/cgdb-0.7.1+20200415+git00e26a3-1.tar.xz
134K ./release/pcre/libpcre16_0/libpcre16_0-8.43-1.tar.xz
133K ./release/gperf/gperf-3.1-1.tar.xz
133K ./release/gts/libgts0.7_5/libgts0.7_5-20121130-1.tar.bz2
131K ./release/libXi/libXi6/libXi6-1.7.10-1.tar.xz
129K ./release/kbproto/kbproto-1.0.7-1.tar.xz
127K ./release/p11-kit/p11-kit-0.23.20-1.tar.xz
127K ./release/pcre/libpcre32_0/libpcre32_0-8.43-1.tar.xz
125K ./release/gzip/gzip-1.8-1.tar.xz
125K ./release/aewm++/aewm++-1.1.2-1.tar.bz2
124K ./release/lcms2/liblcms2_2/liblcms2_2-2.11-1.tar.xz
122K ./release/gettext/gettext-0.18.3.2-2.tar.xz
120K ./release/compiler-rt/compiler-rt-8.0.1-1.tar.xz
119K ./release/jasper/libjasper4/libjasper4-2.0.14-1.tar.xz
119K ./release/libepoxy/libepoxy0/libepoxy0-1.4.3-1.tar.xz
118K ./release/less/less-551-1.tar.xz
117K ./release/openjpeg2/libopenjp2_7/libopenjp2_7-2.3.0-1.tar.xz
117K ./release/jasper/libjasper1/libjasper1-1.900.22-1.tar.xz
117K ./release/indent/indent-2.2.12-1.tar.xz
115K ./release/libssh2/libssh2_1/libssh2_1-1.7.0-1.tar.xz
115K ./release/nettle/libhogweed2/libhogweed2-2.7.1-1.tar.xz
113K ./release/libxcb/libxcb1/libxcb1-1.14-1.tar.xz
112K ./release/libICE/libICE6/libICE6-1.0.10-1.tar.xz
111K ./release/mesa/libGL1/libGL1-19.1.6-1.tar.xz
111K ./release/tiff/libtiff5/libtiff5-3.9.7-4.tar.xz
108K ./release/nspr/libnspr4/libnspr4-4.21-1.tar.xz
108K ./release/libiconv/libiconv-1.16-2.tar.xz
107K ./release/inputproto/inputproto-2.3.1-1.tar.xz
106K ./release/libarchive/libarchive2/libarchive2-2.8.3-1.tar.bz2
106K ./release/patch/patch-2.7.4-1.tar.xz
106K ./release/flac/flac-devel/flac-devel-1.3.1-1.tar.xz
104K ./release/psmisc/psmisc-22.16-1.tar.bz2
104K ./release/dbus/libdbus1_3/libdbus1_3-1.10.22-1.tar.xz
104K ./release/libjpeg-turbo/libjpeg8/libjpeg8-1.5.3-1.tar.xz
102K ./release/gd/libgd3/libgd3-2.3.0-1.tar.xz
102K ./release/libxcrypt/libcrypt2/libcrypt2-4.4.4-1.tar.xz
101K ./release/nettle/libhogweed4/libhogweed4-3.4.1-1.tar.xz
100K ./release/glib2.0-networking/glib2.0-networking-2.54.1-1.tar.xz
  99K ./release/p11-kit/p11-kit-trust/p11-kit-trust-0.23.20-1.tar.xz
  96K ./release/sqlite3/sqlite3-3.28.0-1.tar.xz
  95K ./release/nettle/libnettle6/libnettle6-3.4.1-1.tar.xz
  95K ./release/readline/libreadline7/libreadline7-7.0.3-3.tar.xz
  93K ./release/perl-JSON-XS/perl-JSON-XS-4.03-1.tar.xz
  88K ./release/libXmu/libXmu6/libXmu6-1.1.3-1.tar.xz
  87K ./release/perl-HTML-Parser/perl-HTML-Parser-3.71-2.tar.xz
  85K ./release/pcre/libpcre0/libpcre0-8.21-2.tar.bz2
  85K ./release/libXi/libXi-devel/libXi-devel-1.7.10-1.tar.xz
  84K ./release/nettle/libnettle4/libnettle4-2.7.1-1.tar.xz
  84K ./release/libXext/libXext6/libXext6-1.3.4-1.tar.xz
  84K ./release/ncurses/terminfo/terminfo-6.1-1.20190727.tar.xz
  83K ./release/libSM/libSM6/libSM6-1.2.3-1.tar.xz
  82K ./release/rlwrap/rlwrap-0.37-1.tar.bz2
  81K ./release/gcc/libgomp1/libgomp1-10.2.0-1.tar.xz
  80K ./release/audiofile/libaudiofile1/libaudiofile1-0.3.6-2.tar.xz
  79K ./release/libpng/libpng-devel/libpng-devel-1.6.37-1.tar.xz
  76K ./release/libpng/libpng-doc/libpng-doc-1.6.16-1.tar.xz
  75K ./release/libvorbis/libvorbis0/libvorbis0-1.3.6-1.tar.xz
  74K ./release/c-ares/libcares2/libcares2-1.14.0-1.tar.xz
  74K ./release/libvorbis/libvorbisenc2/libvorbisenc2-1.3.6-1.tar.xz
  74K ./release/dash/dash-0.5.9.1-1.tar.xz
  74K ./release/krb5/libk5crypto3/libk5crypto3-1.15.2-2.tar.xz
  73K ./release/cygutils/cygutils-1.4.16-2.tar.xz
  73K ./release/freeglut/libglut3/libglut3-3.2.1-1.tar.xz
  72K ./release/desktop-file-utils/desktop-file-utils-0.23-1.tar.xz
  72K ./release/libedit/libedit0/libedit0-20130712-1.tar.xz
  72K ./release/alternatives/alternatives-1.3.30c-10.tar.bz2
  71K ./release/libofx/libofx6/libofx6-0.9.9-1.tar.xz
  71K ./release/bzip2/libbz2-devel/libbz2-devel-1.0.8-1.tar.xz
  70K ./release/libX11/libX11-devel/libX11-devel-1.7.0-1.tar.xz
  70K ./release/gettext/libintl-devel/libintl-devel-0.19.8.1-2.tar.xz
  70K ./release/libtirpc/libtirpc3/libtirpc3-1.1.4-1.tar.xz
  69K ./release/cygrunsrv/cygrunsrv-1.62-1.tar.xz
  68K ./release/libxkbfile/libxkbfile1/libxkbfile1-1.1.0-1.tar.xz
  67K ./release/gnome-menus/gnome-menus-3.13.3-3.tar.xz
  67K ./release/libcroco0.6/libcroco0.6-0.6.12-1.tar.xz
  65K ./release/libpng/libpng15/libpng15-1.5.18-1.tar.xz
  65K ./release/libofx/libofx-common/libofx-common-0.9.12-1.tar.xz
  65K ./release/libfido2/libfido2-1.5.0-1.tar.xz
  64K ./release/at-spi2-core/at-spi2-core-2.26.2-1.tar.xz
  62K ./release/libffi/libffi6/libffi6-3.2.1-1.tar.xz
  60K ./release/libassuan/libassuan0/libassuan0-2.5.3-1.tar.xz
  60K ./release/byacc/byacc-20170430-1.tar.xz
  60K ./release/libxcb/libxcb-devel/libxcb-devel-1.14-1.tar.xz
  59K ./release/libXext/libXext-devel/libXext-devel-1.3.4-1.tar.xz
  59K ./release/mcpp/libmcpp0/libmcpp0-2.7.2-2.tar.xz
  58K ./release/tcp_wrappers/tcp_wrappers-7.6-26.tar.xz
  58K ./release/libgc/libgc1/libgc1-8.0.4-1.tar.xz
  56K ./release/nghttp2/libnghttp2_14/libnghttp2_14-1.37.0-1.tar.xz
  54K ./release/libcxxabi/libc++abi1/libc++abi1-8.0.1-1.tar.xz
  53K ./release/perl-Compress-Bzip2/perl-Compress-Bzip2-2.22-1.tar.xz
  53K ./release/expat/libexpat1/libexpat1-2.2.6-1.tar.xz
  52K ./release/bvi/bvi-1.3.2-3.tar.xz
  51K ./release/libidn2/libidn2_0/libidn2_0-2.2.0-1.tar.xz
  51K ./release/aewm++-goodies/aewm++-goodies-1.0-2.tar.xz
  51K ./release/gamin/gamin-0.1.10-15.tar.xz
  51K ./release/at-spi2-core/libatspi0/libatspi0-2.26.2-1.tar.xz
  50K ./release/libpsl/libpsl5/libpsl5-0.21.0-1.tar.xz
  50K ./release/mesa/libEGL1/libEGL1-19.1.6-1.tar.xz
  49K ./release/clang/clang-3.7.1-1.tar.xz
  48K ./release/libXdmcp/libXdmcp6/libXdmcp6-1.1.3-1.tar.xz
  48K ./release/perl-Digest-SHA/perl-Digest-SHA-6.02-2.tar.xz
  47K ./release/libpng/libpng16-devel/libpng16-devel-1.6.37-1.tar.xz
  46K ./release/libcanberra/libcanberra0/libcanberra0-0.30-2.tar.xz
  45K ./release/libXtst/libXtst6/libXtst6-1.2.3-1.tar.xz
  45K ./release/libXft/libXft2/libXft2-2.3.3-1.tar.xz
  43K ./release/gcc/libgcc1/libgcc1-10.2.0-1.tar.xz
  42K ./release/libXpm/libXpm4/libXpm4-3.5.13-1.tar.xz
  42K ./release/attr/attr-2.4.48-2.tar.xz
  41K ./release/libnsl/libnsl2/libnsl2-1.2.0-1.tar.xz
  41K ./release/librest0.7/librest0.7_0/librest0.7_0-0.8.1-1.tar.xz
  41K ./release/randrproto/randrproto-1.5.0-1.tar.xz
  40K ./release/libusb-win32/libusb0/libusb0-1.2.6.0-2.tar.xz
  40K ./release/liblzo2/liblzo2_2/liblzo2_2-2.10-2.tar.xz
  40K ./release/dconf/dconf-service/dconf-service-0.26.1-1.tar.xz
  39K ./release/libidn/libidn11/libidn11-1.33-1.tar.xz
  39K ./release/mpclib/libmpc3/libmpc3-1.2.1-1.tar.xz
  39K ./release/libproxy/libproxy1/libproxy1-0.4.14-2.tar.xz
  37K ./release/nas/libaudio2/libaudio2-1.9.3-1.tar.bz2
  36K ./release/libLASi/libLASi1/libLASi1-1.1.1-2.tar.xz
  36K ./release/bzip2/bzip2-1.0.8-1.tar.xz
  35K ./release/ruby/ruby-psych/ruby-psych-2.2.4-1.tar.xz
  34K ./release/run/run-1.3.4-2.tar.xz
  34K ./release/mkfontscale/mkfontscale-1.2.1-1.tar.xz
  34K ./release/luit/luit-20201003-1.tar.xz
  32K ./release/graphviz/libcgraph6/libcgraph6-2.40.1-5.tar.xz
  32K ./release/tdb/libtdb1/libtdb1-1.3.18-1.tar.xz
  31K ./release/perl-IO-Tty/perl-IO-Tty-1.15-1.tar.xz
  31K ./release/libtasn1/libtasn1_6/libtasn1_6-4.14-1.tar.xz
  31K ./release/mesa/libglapi0/libglapi0-19.1.6-1.tar.xz
  31K ./release/perl-B-Generate/perl-B-Generate-1.50-1.tar.xz
  30K ./release/libXrandr/libXrandr2/libXrandr2-1.5.2-1.tar.xz
  30K ./release/lz4/liblz4_1/liblz4_1-1.7.5-1.tar.xz
  30K ./release/libao/libao4/libao4-1.2.0-3.tar.xz
  29K ./release/libdeflate/libdeflate0/libdeflate0-1.7-1.tar.xz
  28K ./release/libXrender/libXrender1/libXrender1-0.9.10-1.tar.xz
  28K ./release/libXcursor/libXcursor1/libXcursor1-1.2.0-1.tar.xz
  28K ./release/jbigkit/jbigkit-2.0-14.tar.xz
  27K ./release/graphviz/lua-gv/lua-gv-2.40.1-5.tar.xz
  27K ./release/graphviz/python27-gv/python27-gv-2.40.1-5.tar.xz
  27K ./release/graphviz/python2-gv/python2-gv-2.40.1-3.tar.xz
  26K ./release/libao/libao-1.2.0-3.tar.xz
  26K ./release/pkgconf/pkgconf-1.6.3-1.tar.xz
  26K ./release/bzip2/libbz2_1/libbz2_1-1.0.8-1.tar.xz
  24K ./release/ncurses/terminfo0/terminfo0-5.5_20061104-12.tar.bz2
  24K ./release/procps-ng/libprocps8/libprocps8-3.3.16-1.tar.xz
  24K ./release/gdbm/libgdbm6/libgdbm6-1.18.1-1.tar.xz
  24K ./release/procps-ng/libprocps7/libprocps7-3.3.15-1.tar.xz
  23K ./release/procps-ng/libprocps-ng6/libprocps-ng6-3.3.12-2.tar.xz
  23K ./release/jbigkit/libjbig2/libjbig2-2.0-14.tar.xz
  22K ./release/setxkbmap/setxkbmap-1.3.2-1.tar.xz
  22K ./release/gdbm/libgdbm4/libgdbm4-1.13-1.tar.xz
  22K ./release/graphviz/graphviz-demo/graphviz-demo-2.40.1-5.tar.xz
  22K ./release/renderproto/renderproto-0.11.1-1.tar.bz2
  22K ./release/crypt/libcrypt0/libcrypt0-2.1-1.tar.xz
  22K ./release/shutdown/shutdown-2.0-2.tar.xz
  22K ./release/perl-TermReadKey/perl-TermReadKey-2.38-2.tar.xz
  21K ./release/libasyncns/libasyncns0/libasyncns0-0.8-1.tar.bz2
  21K ./release/ncurses/termcap/termcap-5.7_20091114-14.tar.bz2
  21K ./release/graphviz/ruby-gv/ruby-gv-2.40.1-5.tar.xz
  21K ./release/libfontenc/libfontenc1/libfontenc1-1.1.4-1.tar.xz
  21K ./release/pkgconf/libpkgconf3/libpkgconf3-1.6.3-1.tar.xz
  20K ./release/popt/libpopt0/libpopt0-1.16-2.tar.xz
  20K ./release/libXau/libXau6/libXau6-1.0.9-1.tar.xz
  19K ./release/perl-Socket6/perl-Socket6-0.25-1.tar.xz
  19K ./release/brotli/libbrotlidec1/libbrotlidec1-1.0.9-1.tar.xz
  19K ./release/popt/libpopt-common/libpopt-common-1.16-2.tar.xz
  19K ./release/argon2/libargon2_1/libargon2_1-20171227-1.tar.xz
  19K ./release/ruby/ruby-io-console/ruby-io-console-0.4.6-1.tar.xz
  18K ./release/libargp/libargp-20110921-3.tar.xz
  18K ./release/fribidi/libfribidi0/libfribidi0-0.19.7-1.tar.xz
  18K ./release/gettext/libintl8/libintl8-0.19.8.1-2.tar.xz
  18K ./release/getent/getent-2.18.90-4.tar.xz
  17K ./release/login/login-1.13-1.tar.xz
  17K ./release/libpipeline/libpipeline1/libpipeline1-1.5.1-1.tar.xz
  17K ./release/libXfixes/libXfixes3/libXfixes3-5.0.3-1.tar.xz
  16K ./release/krb5/libkrb5support0/libkrb5support0-1.15.2-2.tar.xz
  16K ./release/perl-PadWalker/perl-PadWalker-2.0-1.tar.xz
  16K ./release/gsm/libgsm1/libgsm1-1.0.17-1.tar.xz
  16K ./release/libssh/libssh-common/libssh-common-0.8.7-1.tar.xz
  16K ./release/libmetalink/libmetalink3/libmetalink3-0.1.2-1.tar.bz2
  15K ./release/libtool/libltdl7/libltdl7-2.4.6-7.tar.xz
  15K ./release/fixesproto/fixesproto-5.0-1.tar.bz2
  15K ./release/graphviz/libpathplan4/libpathplan4-2.40.1-5.tar.xz
  15K ./release/libunwind/libunwind1/libunwind1-8.0.1-1.tar.xz
  14K ./release/libxcb/libxcb-glx0/libxcb-glx0-1.14-1.tar.xz
  14K ./release/libcbor/libcbor-0.5.0-1.tar.xz
  14K ./release/hostname/hostname-3.13-1.tar.bz2
  14K ./release/chere/chere-1.4-1.tar.bz2
  14K ./release/brotli/libbrotli-devel/libbrotli-devel-1.0.9-1.tar.xz
  14K ./release/dbus/dbus-x11/dbus-x11-1.10.22-1.tar.xz
  14K ./release/python2/python2-devel/python2-devel-2.7.18-1.tar.xz
  14K ./release/libXinerama/libXinerama1/libXinerama1-1.1.4-1.tar.xz
  13K ./release/tcp_wrappers/libwrap0/libwrap0-7.6-26.tar.xz
  13K ./release/esound/libesd0/libesd0-0.2.41-12.tar.bz2
  13K ./release/esound/libesd-devel/libesd-devel-0.2.41-12.tar.bz2
  12K ./release/gamin/libfam0/libfam0-0.1.10-15.tar.xz
  12K ./release/s2tc/s2tc-1.0-2.20151227gitf6ec862.tar.xz
  12K ./release/libXdamage/libXdamage1/libXdamage1-1.1.5-1.tar.xz
  12K ./release/perl-common-sense/perl-common-sense-3.75-1.tar.xz
  11K ./release/graphviz/libcdt5/libcdt5-2.40.1-5.tar.xz
  11K ./release/libICE/libICE-devel/libICE-devel-1.0.10-1.tar.xz
  11K ./release/libdatrie/libdatrie1/libdatrie1-0.2.8-1.tar.xz
  11K ./release/libxcb/libxcb-render0/libxcb-render0-1.14-1.tar.xz
9.7K ./release/ipc-utils/ipc-utils-1.0-1.tar.bz2
9.6K ./release/libogg/libogg0/libogg0-1.3.1-1.tar.bz2
9.2K ./release/arts/libartsc0/libartsc0-1.5.10-4.tar.xz
9.0K ./release/libtxc_dxtn/libtxc_dxtn-1.0.1-2.tar.xz
8.3K ./release/mesa/libOpenVG1/libOpenVG1-10.3.7-1.tar.xz
7.5K ./release/raqm/libraqm0/libraqm0-0.7.0-1.tar.xz
7.4K ./release/libogg/libogg-devel/libogg-devel-1.3.1-1.tar.bz2
7.2K ./release/sqlite3/sqlite3-vfslog/sqlite3-vfslog-3.28.0-1.tar.xz
6.9K ./release/editrights/editrights-1.03-1.tar.xz
6.8K ./release/attr/libattr1/libattr1-2.4.48-2.tar.xz
6.5K ./release/glu/libGLU-devel/libGLU-devel-9.0.1-1.tar.xz
6.3K ./release/gcc/libatomic1/libatomic1-10.2.0-1.tar.xz
6.2K ./release/libxcb/libxcb-xfixes0/libxcb-xfixes0-1.14-1.tar.xz
5.9K ./release/font-alias/font-alias-1.0.3-1.tar.bz2
5.7K ./release/pkgconf/pkg-config/pkg-config-1.6.3-1.tar.xz
5.5K ./release/libXmu/libXmuu1/libXmuu1-1.1.3-1.tar.xz
5.1K ./release/libXau/libXau-devel/libXau-devel-1.0.9-1.tar.xz
4.5K ./release/libpaper/libpaper1/libpaper1-1.1.28-1.tar.xz
4.5K ./release/e2fsprogs/libcom_err2/libcom_err2-1.44.5-1.tar.xz
4.4K ./release/libao/libao-devel/libao-devel-1.2.0-3.tar.xz
4.3K ./release/libxcb/libxcb-dri2_0/libxcb-dri2_0-1.14-1.tar.xz
4.2K ./release/gdbm/libgdbm_compat4/libgdbm_compat4-1.18.1-1.tar.xz
4.0K ./release/libXdmcp/libXdmcp-devel/libXdmcp-devel-1.1.3-1.tar.xz
4.0K ./release/gcc/libssp0/libssp0-6.4.0-4.tar.xz
3.9K ./release/catgets/libcatgets1/libcatgets1-1.1-2.tar.bz2
3.8K ./release/libsigsegv/libsigsegv2/libsigsegv2-2.10-2.tar.xz
3.8K ./release/pcre/libpcreposix0/libpcreposix0-8.43-1.tar.xz
3.5K ./release/libxcb/libxcb-shm0/libxcb-shm0-1.14-1.tar.xz
2.6K ./release/libiconv/libcharset1/libcharset1-1.16-2.tar.xz
2.6K ./release/gcc/libvtv0/libvtv0-5.4.0-1.tar.xz
2.2K ./release/libX11/libX11-xcb1/libX11-xcb1-1.7.0-1.tar.xz
  656 ./release/cygutils/cygutils-x11/cygutils-x11-1.4.16-2.tar.xz
  328 ./release/python2/python2-2.7.18-1.tar.xz
  316 ./release/python3/python3-3.6.8-1.tar.xz
  268 ./release/perl/perl_autorebase/perl_autorebase-5.30.3-1.tar.xz
  252 ./release/python3/python3-devel/python3-devel-3.6.8-1.tar.xz
  232 ./release/perl/perl_vendor/perl_vendor-5.14.4-1.tar.xz
  108 ./release/crypt/crypt-2.1-1.tar.xz
  108 ./release/freeglut/freeglut-doc/freeglut-doc-3.0.0-1.tar.xz
  108 ./release/mpclib/mpclib-1.1.0-1.tar.xz
  108 ./release/mpfr/mpfr-4.0.2-1.tar.xz
  108 ./release/openssl10/libopenssl100/libopenssl100-1.0.2s-1.tar.xz
  108 ./release/perl-Data-Alias/perl-Data-Alias-1.20-2.tar.xz
  108 ./release/python2/python/python-2.7.16-1.tar.xz
  108 ./release/python-gobject/python-gobject-2.28.7-1.tar.xz
   46 ./release/tcl-tk/tcltk/tcltk-20120206-1.tar.bz2
   32 ./release/man-db/man/man-2.6.7-2.tar.xz
   32 ./release/popt/popt-1.16-2.tar.xz
   32 ./release/procps-ng/procps/procps-3.3.10-1.tar.xz
  17M ./setup.ini
5.7M ./release/vim/vim-common/vim-common-8.2.0486-1.tar.xz
4.6M ./release/w32api-headers/w32api-headers-8.0.0-1.tar.xz
1.8M ./release/vim/vim-doc/vim-doc-8.2.0486-1.tar.xz
1.4M ./release/util-linux/util-linux-2.33.1-2.tar.xz
1.4M ./release/w32api-runtime/w32api-runtime-8.0.0-1.tar.xz
1.4M ./release/vim/gvim/gvim-8.2.0486-1.tar.xz
1.3M ./release/vim/vim-8.2.0486-1.tar.xz
1.1M ./release/xorg-server/xorg-server-1.20.10-1.tar.xz
868K ./release/wget/wget-1.20.3-2.tar.xz
713K ./release/xextproto/xextproto-7.3.0-1.tar.xz
568K ./release/vim/vim-minimal/vim-minimal-8.2.0486-1.tar.xz
430K ./release/zstd/zstd-1.4.8-1.tar.xz
380K ./release/xterm/xterm-360-1.tar.xz
244K ./release/xproto/xproto-7.0.28-1.tar.xz
237K ./release/tiff/tiff-4.0.9-1.tar.xz
236K ./release/zstd/libzstd1/libzstd1-1.4.8-1.tar.xz
207K ./release/zip/zip-3.0-12.tar.xz
178K ./release/unzip/unzip-6.0-17.tar.xz
176K ./release/xz/xz-5.2.4-1.tar.xz
154K ./release/xwin-xdg-menu/xwin-xdg-menu-20170321-1.tar.xz
153K ./release/tzcode/tzcode-2020d-1.tar.xz
150K ./release/util-linux/libfdisk1/libfdisk1-2.33.1-2.tar.xz
120K ./release/zlib/zlib-devel/zlib-devel-1.2.11-1.tar.xz
112K ./release/util-linux/libblkid1/libblkid1-2.33.1-2.tar.xz
  98K ./release/twm/twm-1.0.11-1.tar.xz
  95K ./release/xkbcomp/xkbcomp-1.4.3-1.tar.xz
  73K ./release/xz/liblzma5/liblzma5-5.2.4-1.tar.xz
  69K ./release/xz/liblzma1/liblzma1-4.999.9beta-11.tar.bz2
  66K ./release/typespeed/typespeed-0.6.5-2.tar.xz
  57K ./release/xinit/xinit-1.4.1-1.tar.xz
  56K ./release/vim/xxd/xxd-8.2.0486-1.tar.xz
  51K ./release/xdg-user-dirs/xdg-user-dirs-0.16-1.tar.xz
  42K ./release/zlib/zlib0/zlib0-1.2.11-1.tar.xz
  42K ./release/yaml/libyaml0_2/libyaml0_2-0.1.6-2.tar.xz
  36K ./release/time/time-1.9-1.tar.xz
  36K ./release/zlib/zlib-1.2.11-1.tar.xz
  34K ./release/xauth/xauth-1.1-1.tar.xz
  30K ./release/which/which-2.20-2.tar.bz2
  29K ./release/xinit/xinit-debuginfo/xinit-debuginfo-1.3.4-5.tar.xz
  28K ./release/xmodmap/xmodmap-1.0.10-1.tar.xz
  27K ./release/xrdb/xrdb-1.2.0-1.tar.xz
  25K ./release/xcb-util-wm/libxcb-ewmh2/libxcb-ewmh2-0.4.1-1.tar.xz
  19K ./release/xcb-util/libxcb-util1/libxcb-util1-0.4.0-1.tar.xz
  16K ./release/xeyes/xeyes-1.1.2-1.tar.xz
  15K ./release/xf86-video-dummy/xf86-video-dummy-0.3.8-1.tar.xz
  12K ./release/util-linux/libuuid1/libuuid1-2.33.1-2.tar.xz

--
Kamran
Islamabad, Pakistan
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
Reply | Threaded
Open this post in threaded view
|

Re: "ls" sorts wrongly if given large number of files

Cygwin list mailing list

Am 06.01.2021 um 19:17 schrieb Kamran via Cygwin:

> Hi all
>
> "ls" (version 8.26) sorts wrongly if given large number of files via "find" or "xargs"
>
> For example:
>
> find -type f -exec ls -oS -h {} +
>
> OR
>
> find -type f -print0 | xargs -0r ls -oS -h
>
> Gives following data. Sorry for the long listing, and wrapped lines. But search for "setup.ini" which is about 17 MB, it is sorted AFTER very small files.
>
> In fact it seams that sorting is restarted from that file (subsequent files are again sorted). Note also that removing "-h" from "ls" command lines results in the same problem.
>
> (output is trimmed to remove unnecessary data, i.e. perms/user/date-time, but order is the same)
>
>  26M ./release/gcc/gcc-core/gcc-core-10.2.0-1.tar.xz
>  24M ./release/binutils/binutils-2.34+1git.de9c1b7cfe-1.tar.xz
> [...]
> 108 ./release/python2/python/python-2.7.16-1.tar.xz
>  108 ./release/python-gobject/python-gobject-2.28.7-1.tar.xz
>   46 ./release/tcl-tk/tcltk/tcltk-20120206-1.tar.bz2
>   32 ./release/man-db/man/man-2.6.7-2.tar.xz
>   32 ./release/popt/popt-1.16-2.tar.xz
>   32 ./release/procps-ng/procps/procps-3.3.10-1.tar.xz
>  17M ./setup.ini
> 5.7M ./release/vim/vim-common/vim-common-8.2.0486-1.tar.xz
> 4.6M ./release/w32api-headers/w32api-headers-8.0.0-1.tar.xz
> 1.8M ./release/vim/vim-doc/vim-doc-8.2.0486-1.tar.xz
> [...]
> 16K ./release/xeyes/xeyes-1.1.2-1.tar.xz
>  15K ./release/xf86-video-dummy/xf86-video-dummy-0.3.8-1.tar.xz
>  12K ./release/util-linux/libuuid1/libuuid1-2.33.1-2.tar.xz
>
xargs uses multiple calls to ls and find calls ls once for each matching file so in the two mentioned cases ls will not get to see the full list and thus can't sort all the files. This is the expected bahviour and not special to cygwin.
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
Reply | Threaded
Open this post in threaded view
|

Re: "ls" sorts wrongly if given large number of files

Brian Inglis
In reply to this post by Cygwin list mailing list
On 2021-01-06 11:17, Kamran via Cygwin wrote:

> "ls" (version 8.26) sorts wrongly if given large number of files via "find" or
> "xargs"
>
> For example:
>
> find -type f -exec ls -oS -h {} +
>
> OR
>
> find -type f -print0 | xargs -0r ls -oS -h
>
> Gives following data. Sorry for the long listing, and wrapped lines. But search
> for "setup.ini" which is about 17 MB, it is sorted AFTER very small files.
>
> In fact it seams that sorting is restarted from that file (subsequent files are
> again sorted). Note also that removing "-h" from "ls" command lines results in
> the same problem.
>
> (output is trimmed to remove unnecessary data, i.e. perms/user/date-time, but
> order is the same)

Shells and programs have limited command line lengths, so the target program may
be run multiple times by find or xargs, more times when the file path names are
long, as fewer file path names can fit in each command line, so output line
lengths from ls and numbers of files sorted together will vary.
You can reduce this impact by changing to the closest common directory to your
files, and using shell and ls options and features to get similar results e.g.

$ ( cd .../release/; ls -hoS **/*.{tar.*z*,ini}; )

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
Reply | Threaded
Open this post in threaded view
|

Re: "ls" sorts wrongly if given large number of files

Eliot Moss
In reply to this post by Cygwin list mailing list

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
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
Reply | Threaded
Open this post in threaded view
|

Re: "ls" sorts wrongly if given large number of files

Hans-Bernhard Bröker
In reply to this post by Cygwin list mailing list
Am 06.01.2021 um 19:17 schrieb Kamran via Cygwin:
> Hi all
>
> "ls" (version 8.26) sorts wrongly if given large number of files via
> "find" or "xargs"


Actually ls is working just fine here.  You just misunderstand how
"find" works in this case.

To see what actually happens, you should run

        find -type f -exec echo {} +  | wc -l

in that same directory you did your test case in.   You'll find it does
_not_ print 1.  Now ponder what that means.

For further information, RTFM at:

        info "finding files" Actions run multi

about how find builds the command lines it sends to the programs to be
run by "-exec"
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple