Remix.run Logo
amelius 5 days ago

Can you reference the file that was modified latest by me? With one shortcut?

Because that's what I miss most in my shell.

jcynix 5 days ago | parent | next [-]

You mean something like

    print -rl -- *(om[1].)
in zsh?
amelius 5 days ago | parent [-]

No, I mean globally (over all directories, starting from my home directory).

And of course, if the latest file isn't what I wanted, then it should be possible to easily go to the latest file before that.

skydhash 5 days ago | parent | next [-]

Then you need emacs’s dired. There’s a find command that will do that. ;)

cb321 5 days ago | parent | prev [-]

It's 10x slower than a more specialized command [1] for me, but adding recursion only requires adding one extra asterisk (`**` instead of `*`) and maybe a D if you want to include dot files or triple star if you want to follow symlinks:

    $ date; print -rl -- **(om[1].D);date; newest -n4 -r0 $HOME
    Wed Sep 17 12:48:53 EDT 2025
    .config/mozilla/firefox/p9/bounce-tracking-protection.sqlite
    Wed Sep 17 12:49:25 EDT 2025
    /u/p9/.config/mozilla/firefox/p9/permissions.sqlite
    /u/p9/.config/zsh/history
    /u/p9/.config/mozilla/firefox/p9/places.sqlite-wal
    /u/p9/.config/mozilla/firefox/p9/bounce-tracking-protection.sqlite
    *newest -n4 -r0 $HOME
     Time: 1.882365 (u) + 1.318166 (s)=3.215131 (99%) mxRSS 139 MiB
Not sure how to change to get most recent 4 or whatever in the Zsh style (since, you know, that'd be 10x slower..)

[1] https://github.com/c-blake/bu/blob/main/doc/newest.md*

ghtbircshotbe 5 days ago | parent | prev [-]

Reverse shell command search for eg *.txt allows you to look through the most recent text files you've explicitly referenced