3 ms·
You mean something like print -rl -- *(om[1].) in zsh?
by jcynix 1y ago
You mean something like
print -rl -- *(om[1].)
in zsh?
- amelius 1y agoNo, 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 1y agoThen you need emacs’s dired. There’s a find command that will do that. ;)
- cb321 1y agoIt'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* https://github.com/c-blake/bu/blob/main/doc/newest.md*