News for hackers. Stuff that matters.
Re:Show HN: FSQL – Search through your file system with SQL-... by devnonymous on Monday May 15, 2017 @03:13PM (#14344271)
Nice project, wish you the best ! Although tbh, I personally won't use this simply because I know enough of find(1) to not see the cognitive overhead of switching to sql to do filesystem /queries/.

Any examples where this would be better than using find (with the occasional filter thrown in) ?

Re:Show HN: FSQL – Search through your file system with SQL-... by _jal on Monday May 15, 2017 @03:42PM (#14344493)
Subselects would be a pretty awesome feature.

"select name from foo where name not in (select name from ../bar where date < ...)"

I'm usually fine with `find`, but when doing things more interesting than just "find files in this directory that are not in that directory", while uncommon, tend to make me think about my pipeline a bit.

Re:Show HN: FSQL – Search through your file system with SQL-... by taeric on Monday May 15, 2017 @03:47PM (#14344542)
Out of curiosity, I'm interested in how folks would do the "in this not that" folder query. At a gut shot, I'd assume that diff would be used. I'm about to dig through the find man page to see if it has something directly to help.
Re:Show HN: FSQL – Search through your file system with SQL-... by keithlfrost on Monday May 15, 2017 @04:44PM (#14344941)
One tool for this is the 'comm' utility: given two files containing sorted lines, it can output one or more of (1) lines only in file 1, (2) lines only in file 2, and (3) lines common to both files.
Re:Show HN: FSQL – Search through your file system with SQL-... by hoytech on Monday May 15, 2017 @04:09PM (#14344700)
Assuming no dups in file1, this outputs lines in file1 that aren't in file2:

    sort file1 file2 file2 | uniq -u
(double file2 is not a typo :)
Re:Show HN: FSQL – Search through your file system with SQL-... by isometry on Monday May 15, 2017 @04:45PM (#14344946)
Or (a little faster):

  comm -23 <(sort file1) <(sort file2)
Re:Show HN: FSQL – Search through your file system with SQL-... by kshvmdn on Monday May 15, 2017 @05:12PM (#14345165)
Great idea! Got the issue up [0], feel free to add to it if you'd like.

[0] https://github.com/kshvmdn/fsql/issues/4

Re:Show HN: FSQL – Search through your file system with SQL-... by emmelaich on Monday May 15, 2017 @06:45PM (#14345847)
SQL is familiar-ish to a lot of people.

Contrariwise, I rarely see a non-trivial `find` invocation that does not have a few bugs. (including my own!)