Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls & exa differ for -t #696

Closed
fzakaria opened this issue Jul 14, 2020 · 10 comments
Closed

ls & exa differ for -t #696

fzakaria opened this issue Jul 14, 2020 · 10 comments

Comments

@fzakaria
Copy link

Here are the contents of man ls for -t

       --time=WORD
              with  -l,  show  time  as  WORD  instead of default modification time: atime or access or use (-u); ctime or status (-c); also use specified time as sort key if
              --sort=time (newest first)

       -t     sort by modification time, newest first

here are the contents of man exa for -t

       -t, --time=WORD
              which timestamp field to list (modified, changed, accessed, created)

Since exa uses -t as the same flag for --time it means I cannot copy over some muscle memory filters like:

ls -lrt

(sort by time reverse chronological)

I ran into this because I alias exa to ls since I really have enjoyed exa that much ! (Thanks!)

❯ which ls
ls: aliased to exa --color=auto
@fzakaria
Copy link
Author

fzakaria commented Jul 14, 2020

For those interested; in exa the analogous command is exa -lrm; m is short for --sort=modification

@laur89
Copy link

laur89 commented Aug 3, 2020

Also note the sorting order differs between ls & exa, which is why you had to provide -r to exa in your example above.

I'm quite sure following commands should sort the files in same order, yet they're opposite:

exa -l --sort=newest
ls -lt

@fzakaria
Copy link
Author

fzakaria commented Aug 3, 2020

I find the lack of support for ls -lrt and the wrong order (@laur89 you are right!) one of the more frustrating aspects of having alias ls=exa

Excellent software otherwise 👍
I understand the request is a bit of a PITA since it's "hey make your software behave more like another software!" but the argument to alias would help give exa I believe a lot more adoption.

@mschilli87

This comment has been minimized.

@fzakaria
Copy link
Author

fzakaria commented Aug 4, 2020

@mschilli87 is there a more supported fork ?
We should change some of the package management (NixPkgs) to point to it instead.

@mschilli87

This comment has been minimized.

@johnchurchill
Copy link

Not supporting the same switches that ls does is kind of a big deal. It's not just muscle memory and the inconvenience of having to remember which system you're shelled in on to use which switches. Imagine you are working in a team that uses a deployment script that does LATEST_BUILD=$(cd ${BUILDSDIR}; ls -t | grep .war$ | head -1) ... oops it doesn't work for you because you are using exa. So you have to unalias ls before you can use the script, or request that the script be changed to unalias ls for that tiny percentage of people who use an incompatible ls substitute like exa.

@evandena
Copy link

When running "exa -l --sort=newest" files with the same modified time seem to be randomly ordered, where "ls -latr" is consistent.
Is there a way for exa to behave similar to ls in this manner?

@zsimic
Copy link

zsimic commented Feb 26, 2021

+1 I wish exa -t was the same as ls -t

Especially since the --time FIELD seems to be quite the niche thing... (I can totally see it as very seldom used)

It would be great if:

  • -t was the same as ls -t (ie: change current exa -m to be simply exa -t)
  • --time is fine without a one-letter shortcut I think...

@ariasuni
Copy link
Collaborator

ariasuni commented Apr 5, 2021

Closing this in favor of #519.

@ariasuni ariasuni closed this as completed Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants