Querying and filtering notes

settle can also query-filter notes based on various criteria, on various elements of their metadata.

Note that all filters compound, that is to say, any resulting note must match ALL criteria specified, not one or the other.

Also note that all filter options that accept a parameter use regex matching by default, but if you specify the --exact option, then all regex is disabled.

Query parameters

Filter by title

settle query --title ".*word.*" returns all notes whose title contains the word word.

Filter by project

settle query --project "inbox" returns all notes that are in the inbox project.

Filter by tag

NOTE: subtags are also included.

settle query --tag "psychology" returns every note that has a psychology tag.

Filter by text content

settle query --text "sample" returns every note that contains the word "sample"

Filter by forward links

(also read: Links and Backlinks)

settle query --links "Neurons" keeps every note that Neurons links to, i.e. its forward links.

settle query --links ".*connection.*" keeps the links of every note whose title contains the word connection.

Filter by backlinks

settle query --backlinks "Neurons" keeps every note that has forward links pointing to the note called Neurons.

settle query --backlinks ".*connection.*" returns every note that links to any note that has the word connection in its title.

Filter loner notes

settle query --loners keeps all loner notes in your Zettelkasten.

Result format

settle query --format <FORMAT> allows you to specify a certain format according to which you can print every queried note's data. It has a few flags:

settle query --format "%t [%l]" --link_sep "\t" prints the title of every Zettel along with its forward links. Note the --link_sep option; it specifies how both forward and backward links are separated - single tabs, in this case.

The default format is [%p] %t, and the default link separator is |.

Making a graph

(read: Graphs)

settle query --graph takes all the results and outputs the DOT graph result to stdout.

Examples