Bug 814622 - ls fails to sort properly in some cases
ls fails to sort properly in some cases
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
15
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-20 05:47 EDT by Enrique
Modified: 2012-04-20 06:02 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-20 06:02:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Enrique 2012-04-20 05:47:38 EDT
Description of problem:

 I have some files which use _ and . as characters that are not properly sorted.

Version-Release number of selected component (if applicable):
coreutils-8.10-2.fc15.x86_64
coreutils-libs-8.10-2.fc15.x86_64

How reproducible:
Always

Steps to Reproduce:
1.touch file_1 file.1 file_2 file.2     
2. ls -l
  
Actual results:

-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_2
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.2

Expected results:

 info ls states that "By default, the output is sorted alphabetically, according to the locale settings in effect". I would expect the following output:
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_2
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.2

Additional info:
# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Comment 1 Ondrej Vasik 2012-04-20 06:02:55 EDT
Thanks for report. Alphabetic sorting generally depends on LC_COLLATE - try `LC_COLLATE=C ls -l`. This behaviour is not a bug in coreutils ls sorting, if you believe sorting in your locales is wrong, feel free to reopen/reassign that against glibc.

Note You need to log in before you can comment on or make changes to this bug.