Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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


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*




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: