Re:A simple, fast and user-friendly alternative to ‘find’
by reactjavascript on Friday May 20, 2022 @11:55AM
(#31449149)
I just want my entire file system stored in Sqlite so I can query it myself
[ Parent
| on HN ]
Re:A simple, fast and user-friendly alternative to ‘find’
by samatman on Friday May 20, 2022 @12:25PM
(#31449568)
Oh hey look what I just found https://github.com/narumatt/sqlitefs
Re:A simple, fast and user-friendly alternative to ‘find’
by reactjavascript on Friday May 20, 2022 @12:43PM
(#31449820)
>> "mount a sqlite database file as a normal filesystem"
I'm looking to do the opposite. Given a location, recurse it, stat() each file and create the database.
Re:A simple, fast and user-friendly alternative to ‘find’
by neura on Monday May 23, 2022 @11:50AM
(#31480581)
If you happen to be using macOS, there's mdfind, which uses the spotlight database which is always kept up to date, unlike locate/updatedb, where updatedb is expensive to run, even if you've run it recently.
I have yet to find a good solution for linux CLI... something that uses an internal database that is kept up to date with all directory structure changes.
Maybe someone else has seen something cool for this? :D
Re:A simple, fast and user-friendly alternative to ‘find’
by samatman on Friday May 20, 2022 @02:03PM
(#31450673)
It's still not clear to me whether you want the files inside the database or just the metadata. The stat part suggests the latter?
I guess I can see that, but now you have cache invalidation (someone else linked to Spotlight, which does this as a background process). SQLite files can be larger than any physical medium you can purchase so why not go the distance?
Re:A simple, fast and user-friendly alternative to ‘find’
by my69thaccount on Friday May 20, 2022 @01:25PM
(#31450312)
You could also make it as a Sqlite virtual table so it's dynamic.
Also file data is available in osquery: https://osquery.io/schema/5.2.3/#file
Re:A simple, fast and user-friendly alternative to ‘find’
by mi_lk on Friday May 20, 2022 @12:31PM
(#31449639)
updatedb/locate?
Re:A simple, fast and user-friendly alternative to ‘find’
by neura on Monday May 23, 2022 @11:53AM
(#31480613)
updatedb is expensive to run and is usually run by a cron job, whereas something like mdfind on macos uses spotlight, which is kept up to date with all filesystem changes (or at least reasonably fast).
Anybody know of something like that for linux?
Re:A simple, fast and user-friendly alternative to ‘find’
by smoothgrammer on Friday May 20, 2022 @02:48PM
(#31451119)
I'm shocked so many people forget this
Re:A simple, fast and user-friendly alternative to ‘find’
by cb321 on Friday May 20, 2022 @04:27PM
(#31452114)
https://plocate.sesse.net/ is even better
Re:A simple, fast and user-friendly alternative to ‘find’
by jeffbee on Friday May 20, 2022 @12:28PM
(#31449597)
Sounds like macOS would be right up your alley then.
Re:A simple, fast and user-friendly alternative to ‘find’
by reactjavascript on Friday May 20, 2022 @12:42PM
(#31449800)
I have MacOS, where is the sqlite file?
Re:A simple, fast and user-friendly alternative to ‘find’
by jeffbee on Friday May 20, 2022 @12:55PM
(#31449985)
/private/var/db/Spotlight-V100/...
Re:A simple, fast and user-friendly alternative to ‘find’
by ashton314 on Friday May 20, 2022 @01:57PM
(#31450618)
Is the parent post referring to `mdfind` perhaps?
Re:A simple, fast and user-friendly alternative to ‘find’
by neura on Monday May 23, 2022 @11:55AM
(#31480635)
Believe so.