1

Fast way to determine if a file is a SQLite database

view story
linux-howto

http://unix.stackexchange.com – I am looking for a way to determine file types in a folder with thousands of files. File names do not reveal much and have no extension but are different types. Specifically I am trying to determine if a file is a sqlite database. When using 'file' command, it determines type of 2-3 files in a second. This seems like a good way to adress the problem, except it is too slow. Then I tried opening each file with sqlite3 and check if I get an error. That way I can check 4-5 files per second. Much better, but I think that there might be a better way to do this. (HowTos)