Skip to content

Commit efc6651

Browse files
James Stone TIL sync botJonas Andersen
James Stone TIL sync bot
authored and
Jonas Andersen
committed
Mon 25 Nov 2024 09:20:43 CET
1 parent cbe76c4 commit efc6651

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sh/finding-sqlite-dbs.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ Lots of applications use sqlite dbs. It can be useful to try and find them all.
66
find . -type f -exec sh -c 'head -c 16 "$1" 2>/dev/null | grep -q "^SQLite format" && echo "$1"' _ {} \;
77
```
88

9-
as all sqlite files start with the header string: "SQLite format 3\000" , see: [Database File Format](https://www.sqlite.org/fileformat.html)
9+
as all sqlite files start with the header string: "SQLite format 3\000" , see: [Database File Format](https://www.sqlite.org/fileformat.html)
10+
11+
it can then be helpful to get the size of each result
12+
13+
```
14+
find . -type f -exec sh -c 'head -c 16 "$1" 2>/dev/null | grep -q "^SQLite format" && echo "$1 $(stat -c%s "$1" | numfmt --to=iec)"' _ {} \;
15+
```

0 commit comments

Comments
 (0)