Bug 814622

Summary: ls fails to sort properly in some cases
Product: [Fedora] Fedora Reporter: Enrique <cquike>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: kdudka, maxamillion, ovasik, p, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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:
Cloudforms Team: ---

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.