Created
April 16, 2024 04:41
-
-
Save stevehenderson/86080b266773d44c6dc088f4044fd230 to your computer and use it in GitHub Desktop.
Index a folder and store it in SQLite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~/Downloads -type f -exec stat -c "%n|%s|%y" {} \; | awk -F"|" '{printf("INSERT INTO files (file_path, file_size, file_date) VALUES ('\''%s'\'', %s, '\''%s'\'');\n", $1, $2, $3)}' | sqlite3 mydb.db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment