Live data from Hacker News

Show HN: FSQL – Search through your file system with SQL-esque queries

github.com

91–100 of 132 posts

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#91
post #90
post #80

Earlier quoted context omitted.

You could use the audit subsystem. https://www.linux.com/learn/customized-file-monitoring-audit...

Definitely crossed my mind, but I'm working on hosts where installing auditd isn't really easy. Broken yum and apt all over the place makes installing new packages almost impossible. Same goes for lsof, but its installed in "enough" places. Kinda nightmarish, but it gives me a chance to write some fun code ;). Also, thanks for the article! Super interesting. Think that'd be better than implementing something on top o…

Auditd has the advantage of not being intermittent polling, which could miss something. Sounds like it isn't an option though.

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#92

For those of us on Windows: Everything [1] does the job quite nicely with much less verbose syntax. [1] http://voidtools.com

This is pretty amazing. I've been using a Windows program called Agent Ransack [0] for finding files with regex, but this Everything program is so much faster. Incredibly so. Thanks for the tip!

[0] https://www.mythicsoft.com/agentransack

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#93
It probably would be a good idea to mention powershell here. Very powerful and non-kludgy syntax.

I do all my FS operations using that now.

I'll give an example, I recently wanted to back up my arch packages but only the latest version for each package. Here's how I did it after maybe 5-10 minutes of trial and error:

`$k = (Get-ChildItem | Group-Object{ $ns = $_.name.split( "-" ); $filtered= ($ns | %{ if( $_ -match $regex ) {""} else {$_} } ); $joined = ($filtered -join "" ); $joined } )`

`($k | %{ ($_.Group | Sort-Object -Descending LastWriteTime)[0] } ).name | %{ cp $_ /mnt/Data/SuperShare/pkg/ }`

Contrast this with bash where I would still be correcting the spaces after and before '['

Quick PS crash course for those who care:

`Get-Help `

e.g.

`Get-Help New-Alias`

`New-Alias gci Get-ChildItem`

Get-ChildItem is like ls.

`Get-ChildItem -Recurse` has, to my knowledge, no equiv in bash and is equiv to `ls /*` in zsh.

I guess I can write more if any of you guys show interest.

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#94

For those of us on Windows: Everything [1] does the job quite nicely with much less verbose syntax. [1] http://voidtools.com

Everything is pretty awesome, one of the things I really miss on Linux.

When I last looked for a Linux replacement for it, none had the real time updates or the instant search ui, and even those that claimed to index the file system for a quick search were very slow. I actually ended up writing my own hacky and rudimentary GUI over locate to achieve something that fits my needs (and of course doesn't support real time updates).

Maybe things changed since then? Any chance that the HN crowd knows of a good Linux replacement for Everything?

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#97

For those of us on Windows: Everything [1] does the job quite nicely with much less verbose syntax. [1] http://voidtools.com

Everything is pretty awesome, one of the things I really miss on Linux. When I last looked for a Linux replacement for it, none had the real time updates or the instant search ui, and even those that claimed to index the file system for a quick search were very slow. I actually ended up writing my own hacky and rudimentary GUI over locate to achieve something that fits my needs (and of course doesn't support real tim…

I don't know what features exactly Everything has, but maybe fsearch is a good alternative?

http://www.fsearch.org/

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#98

Does anyone remember WinFS (1)? Bill Gates described it as his biggest product regret (2). I remember I thought it was brilliant. Too bad it was probably a little bit too futuristic for its time, as for a few other things they launched when it just was not the right time... the clunky Tablet PCs (3) were for sure another example. (1) https://en.m.wikipedia.org/wiki/WinFS (2) http://www.zdnet.com/article/bill-gates-bi…

While WinFS was a good start, I think the idea of a semantic file system could be extended much further to the whole system (if it weren't for pesky POSIX)

I think most people would expect

/home/geokon/program1/src/

and

/src/program1/home/geokon

to have pretty much the same content

A tag based file system that makes the two equivalent would eliminate all sorta of annoyances where you can't decide how to structure your file hierarchy (should you have bin/program1 bin/program2 sr/program1 src/program2 or program1/src program1/bin program2/src program2/bin? both layouts have their advantages).

Something like a "path/path/bin/path/path/bin" wouldn't work.. but it's hard to find a case where you really need it. And the vast majority of time the subfolders aren't strict subsets of the parent (like mammals/dogs mammals/cats mammals/whales - where dogs/mammals would be a little weird)

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#99
post #11

Seems if the query is always going to start with SELECT, that maybe it should be assumed? I would never use this though, ack or find seem sufficient to me.

Yeah, I like the idea of using sql but it is painful to write. It would be nice to omit the select and the quoting; my suggestion would be that fsql "select * from ..." could be written as select all from ... and all could be assumed if ommitted; so you could write select from or just from ... But unfortunately `select` is a sh(1) reserved word and `from` is an existing command! (shows who who your mail is from) So m…

You can do "alias select=command select", it works in bash and zsh (and maybe others).

In zsh you could also "alias select=noglob command select" and it wouldn't do wildcard matching. Then you could use

    select * from ...
and it would pass the asterisk to your select binary :)

Re: Show HN: FSQL – Search through your file system with SQL-esque queries

#100
post #11

Seems if the query is always going to start with SELECT, that maybe it should be assumed? I would never use this though, ack or find seem sufficient to me.

Yeah, I like the idea of using sql but it is painful to write. It would be nice to omit the select and the quoting; my suggestion would be that fsql "select * from ..." could be written as select all from ... and all could be assumed if ommitted; so you could write select from or just from ... But unfortunately `select` is a sh(1) reserved word and `from` is an existing command! (shows who who your mail is from) So m…

> or just > from ...

Or just ... Why even bother naming fields. Just make enter return everything from anywhere from all time for all people on all platforms.

How many times are we going to have this ridiculous suggestion that less characters/words is automatically better.

This is 'short/arrow functions' (pick your language) all over again, and invariably ends up with the situation where the new syntax is just fucking impossible to read at first glance, because it has so many variances.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Parens are optional. Unless you have no arguments, then they're required. Curly braces are optional, unless you want more than a simple expression, or no return or to return an object literal, then they're required.

I grow weary enough of this bullshit notion that code must 'look pretty', but when you're using "less characters is always best" as the definition for 'pretty' it just becomes unbearable.

Post reply on HN