Show HN: zfind – CLI like find but using SQL syntax and also does tar/zip (github.com)
I wrote this because I needed to search a lot of files, including some archives, for files in a date range but couldn't find any good tools.
Also I never liked find's option syntax. I think most people already know SQL (or at least it's easier to learn) and a much better match for this task.
19 comments
[ 2.9 ms ] story [ 63.5 ms ] threadhttps://github.com/jhspetersson/fselect
fselect still takes the SQL analogy a bit too far for my taste, still cool though :)
Oh and fselect doesn't do tar.
EDIT: seems to be a similar issue with fselect: https://github.com/jhspetersson/fselect/issues/150
i make lots of custom bash file editing and this is gonna help mein the futuré
zfind -w 'size>20k and name="foo"'
I could consider having the first arg reserved for -w
zfind 'size>20k and name="foo"'
but I much prefer the quotes and being allowed to write > instead of gt.
I used gt as bare word but doesn't preclude having escaped or quoted symbols as well, e.g.:
What, no.
I will easily type out `find` invocations dozens/hundreds of time per workday over years and the fact that it requires the path as the first argument and won't accept it as last _still_ trips me up and is my one major gripe.
It's the difference between only searching the desired dirs, versus recursing through your entire filesystem (well, cwd) and then filter results based on path.
Having to go into the middle of the line to change the most commonly changed parameter is bad ergonomics when rerunning stuff from history with small variations often. Especially when basically only find is the special kid and everyone else is happy with it at the end. And it's not like it's ambiguous: find will just throw an error and tell you what you should have typed (as opposed to any other misorder, which it will still run, just not the way you might expect; see above re -path)
Having to cd first would be even worse.
Interspersed/intermixed options have been around for quite a while, though not certain they made their way to golang. If not, the program could handle argument processing itself.