News for hackers. Stuff that matters.
Re:Ask HN: How do you organise your hard drive? by mediocrejoker on Sunday January 06, 2019 @01:59PM (#18839901)
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?

Re:Ask HN: How do you organise your hard drive? by JohnBooty on Tuesday January 08, 2019 @05:01PM (#18860172)
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.

Re:Ask HN: How do you organise your hard drive? by surajrmal on Sunday January 06, 2019 @02:52PM (#18840195)
I assume it's a mashup of frequency and recency.
Re:Ask HN: How do you organise your hard drive? by cilefen on Sunday January 06, 2019 @02:55PM (#18840207)
Re:Ask HN: How do you organise your hard drive? by cilefen on Sunday January 06, 2019 @02:54PM (#18840203)
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.