General
The database file is stored in:
$XDG_DATA_HOME/buku/bookmarks.db, ifXDG_DATA_HOMEis defined (first preference) or$HOME/.local/share/buku/bookmarks.db, ifHOMEis defined (second preference) or%APPDATA%\buku\bookmarks.dbon Windows orthe current directory.
If the URL contains characters like
;,&or brackets, they may be interpreted specially by the shell. To prevent this, place the URL within single or double quotes ('/").URLs are unique in DB. The same URL cannot be added twice.
Bookmarks with immutable titles are listed with
(L)after the title.
Update
If
--title,--tagor--commentis passed without an argument, clear the corresponding field from DB.If
--urlis passed (and--titleis omitted), update the title from web using the URL. Description is updated (if--commentis omitted). Tags remain untouched.If indices are passed without any other options (
--url,--title,--tag,--commentand--immutable), read the URLs from DB and update titles, description and append tags from web. Bookmarks marked immutable are skipped.Can update bookmarks matching a search, when combined with any of the search options and no arguments to update are passed.
Delete
When a record is deleted, the last record is moved to the index.
Delete doesn’t work with range and indices provided together as arguments. It’s an intentional decision to avoid extra sorting, in-range checks and to keep the auto-DB compaction functionality intact. On the same lines, indices are deleted in descending order.
Can delete bookmarks matching a search, when combined with any of the search options and no arguments to delete are passed.
Search
Case insensitive.
Matches words in URL, title and tags.
--sany: match any of the keywords in URL, title or tags. Default search option.--sall: match all the keywords in URL, title or tags.--deep: match substrings (matchmatchesrematched) in URL, title and tags.--sreg: match a regular expression (ignores--deep).--stag: search bookmarks by tags, or list all tags alphabetically with usage count (if no arguments). Delimit the list of tags in the query with,to search for bookmarks that match ANY of the listed tags. Delimit tags with+to search for bookmarks that match ALL of the listed tags. Note that,and+cannot be used together in the same search. Exclude bookmarks matching certain tags from the results by using-followed by the tags. Note that the-operator and the+delimiter must be space separated:-instead of-and+instead of+. This is to distinguish them from hyphenated tags (e.g.,some-tag-name) and tags with+s (e.g.,some+tag+name).Search for keywords along with tag filtering is possible. Two searches are issued (one for keywords and another for tags) and the intersection of the 2 sets is returned as the resultset.
Search results are indexed incrementally. This index is different from actual database index of a bookmark record which is shown within
[]after the title.Order of search results
Results for any keyword matches are ordered by the number of keyword matches — results matching more keywords (match score) will appear earlier in the list. Results having the same number of matches will be ranked by their record DB index. This applies to search queries that are looking to match any of a given set of keywords (using the
-soption or by delimiting keywords with,when using--stag).Queries that look to match all keywords will return records ordered by their DB index, since each record will have the same match score.
Regardless of the search logic used, if only one keyword is searched, results will be ordered by DB index, since all matching records will have the same match score.
Import
Auto-import looks in the default installation path and default user profile.
URLs starting with
place:,file://,chrome://,apt:andabout:are ignored during import.Folder names are automatically imported as tags if
--tacitis used.Tags are merged even if bookmark URL exists when
--tacitis used.
Encryption
Optional and manual. AES-256 algorithm is used. To use encryption, the database file should be unlocked (
-k) before usingbukuand locked (-l) afterwards. Between these 2 operations, the database file lies unencrypted on the disk, and not in memory. Also, note that the database file is unencrypted on creation.
Editor
A single bookmark can be edited before adding. The editor can be set using the environment variable
EDITORor by explicitly specifying the editor. The latter takes preference. If-ais used along with-w, the details are populated in the editor template.In case of edit and update (a single bookmark), the existing record details are fetched from DB and populated in the editor template. The environment variable EDITOR must be set Note that
-uworks independently of-w.All lines beginning with “#” will be stripped. Then line 1 will be treated as the URL, line 2 will be the title, line 3 will be comma separated tags, and the rest of the lines will be parsed as descriptions.
Proxy
Environment variable
https_proxy, if defined, is used to tunnel data for both HTTP and HTTPS connections. The supported format is:
http[s]://[username:password@]proxyhost:proxyport/
Alternative DB file
The option
--db(to specify an alternative database file location) is app-only. Manual usage is prone to issues arising from human error. If you still want to use this option, it may be a good idea to have your own aliases.Note that this option is useful if you want to store the db file in cloud synced location. Another mechanism could be to have the db file synced and create a symlink to it at the default location.