I was listening to a Talk Python To Me podcast that had Simon Willison as the guest. Willison discussed two projects he is developing, Datasette and DogSheep Beta, both of which allow you pull in data as an SQLite database (Datasette) and then index and query it (DogSheep Beta). All your data include Apple Watch data, texts, photo data including lat/long and even the scoring Apple uses to rank your photos.
The two links here are really interesting and I recommend them.
The problem I'm having finding .sqlite files. The directions and the YouTube say to install Datasette and point it against a database on your laptop. I know I can use the Finder for files but I'd like to follow along with youtube.
At around 5:31 in his PyCon AU talk, he types out:
mdfind "kMDItemDisplayName ==*.sqlite" -0 | xargs -0 stat "-f%z %N" | sort -nr | head -n 20
I managed to read the incantation but while I get the gist, there are a number of details that Apple's CLI help pages don't cover.
So, here are my questions:
- What is the
-0flag, specifically? (as opposed to the overly brief example Apple gives)
- What does
xargs -0 stat "-f%z %N"mean?
-nrwhat are the n and r flags for sort?
- finally (and you probably guessed it with order) what is
-nflag for head?