Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 904323

Summary: sys-apps/coreutils-9.1-r2: "ls" - not work reverse order while sorting (--reverse)
Product: Gentoo Linux Reporter: globus <yoric-k>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal CC: ionen
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge.info

Description globus 2023-04-14 10:53:05 UTC
Hello!
Sorry my bad English.
The --reverse key does not work for ls, it works together with the -t key.

Reproducible: Always

Steps to Reproduce:
1.touch 1.test ; touch 2.test ; touch 3.test ; touch 4.test
2.ls -r
3.ls -rt
Actual Results:  
4.test  3.test  2.test  1.test

Expected Results:  
1.test  2.test  3.test  4.test
Comment 1 globus 2023-04-14 11:00:17 UTC
Created attachment 860097 [details]
emerge.info
Comment 2 Ionen Wolkens gentoo-dev 2023-04-14 14:01:55 UTC
I tried with same version but can't reproduce.

Maybe try running `ls --version` just to be sure it's not running a different ls?

Also, what filesystem is this on? (I don't think it should be related, but just in case)

For me:
    $ touch 1.test ; touch 2.test ; touch 3.test ; touch 4.test
    $ ls
    1.test  2.test  3.test  4.test
    $ ls -r
    4.test  3.test  2.test  1.test
    $ ls --version
    ls (GNU coreutils) 9.1
    Packaged by Gentoo (9.1-r2 (p0))
Comment 3 Ionen Wolkens gentoo-dev 2023-04-14 14:03:34 UTC
Also did you get this backward? The former is in reverse, so it's normal.

    Actual Results:  
    4.test  3.test  2.test  1.test

    Expected Results:  
    1.test  2.test  3.test  4.test
Comment 4 globus 2023-04-15 03:21:53 UTC
Sorry, I made a mistake. I didn't take into account that the key in aliases is -U. Without an alias, it worked as it should. I'm very, very sorry. The bug can be closed.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-15 03:22:19 UTC
No worries, thank you for coming back and explaining :)