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

One thing that changed my life is z, a utility to navigate easily to arbitrary directories based on frecency. Makes dir structure a bit less relevant; with z the distance between any two dirs is effectively constant.

https://github.com/rupa/z

     	By project, by tool? What do you do with pdfs and reference stuff, surely not Dewey Decimal?
~/proj ---> all my current projects and stuff i've pulled down from GitHub so I can examine it. usually 20 or so. subdirs for employer, etc

~/Dropbox/personal ---> scanned documents, receipts, etc

~/Dropbox/work ---> subdirs per client/employer

~/Dropbox/ebooks ---> organized into subdirs by topic

~/Dropbox/pdfs ---> web pages i've "printed" to pdf for archiving/reference. organized into subdirs by topic

~/Desktop/old ---> the "junk drawer" i occasionally clean out. doesn't get too big

~/Music ---> mostly just iTunes doing its thing

I also have a truckload of media (games, movies, music) stored on external hard drives since there's not much room for it on the internal SSD.



I thought 'freceny' was a typo until I clicked the link, but sadly the man page doesn't really explain what it is.

Could you maybe give a few examples of how you might find something eg. using find(1), and then how you could find it using z?


Frecency is a portmanteau of "frequency" and "recentness."

I don't know the exact scoring mechanism but potential matches are scored by both frequency of access and recentness of access. Firefox uses this for matches in the URL bar, and I think other browsers do as well.

For `z`, as an example, suppose I have two paths:

~/projects/fun_stuff_1

~/projects/fun_stuff_2

`fun_stuff_1` has been accessed 100 times, but all of those accesses were over two years ago.

`fun_stuff_2` has been accessed only once, but it was five minutes ago.

So if I type `$ z fun_stuff` or even `$z fun` it's going to rank `fun_stuff_2` ahead of `fun_stuff_1` in the possibilities. In practice, while obviously not perfect, frecency tends to match the user's intent a surprisingly high amount of the time... a good frecency implementation is a delight for the user, honestly.


I assume it's a mashup of frequency and recency.



z works a bit like a web browser does when autocompleting URLs from history rather than a file system search tool like find. z “learns” the file system paths as you traverse them in a terminal.




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

Search: