BUKU(1)
π buku(1) β User Commands π
okay bestie, sit down, hydrate, and let me tell you about buku β it's a manual page and it's a whole personality. π
πΈ NAME πΈ
buku β Bookmark manager like a text-based mini-web π
β¨ SYNOPSIS β¨
buku [OPTIONS] [KEYWORD [KEYWORD ...]]
like. that's it. that's the whole incantation. options then keywords, go off. π«Ά
π¦ DESCRIPTION π¦
buku is a command-line utility to store, tag, search and organize bookmarks. No browser extension, no account, no cloud, no nonsense β just you, your terminal, and a database that finally respects your organizational urges. β¨
π Features
- Store bookmarks with auto-fetched title, tags and description π₯
- Auto-import from Firefox, Google Chrome, Chromium, Vivaldi, Brave, and MS Edge
- Open bookmarks and search results in browser
- Browse cached page from the Wayback Machine π°οΈ
- Text editor integration
- Lightweight, clean interface, custom colors π
- Powerful search options (regex, substring...)
- Continuous search with on the fly mode switch
- Portable, merge-able database to sync between systems
- Import/export bookmarks from/to HTML, XBEL, Markdown, RSS/Atom or Orgfile
- Smart tag management using redirection (
>>,>,<<) π - Multi-threaded full DB refresh
- Manual encryption support
- Shell completion scripts, man page with handy examples
- Privacy-aware (no unconfirmed user data collection) π
- Can be used as a Python library π
- Has a compation Web-application (Bukuserver) with an HTTP-based API (for personal use only)
fr fr, that last one says "compation". that's what it says. we keep it. accuracy is the whole point. π«Ά
π OPERATIONAL NOTES π
- The database file is stored in:
$BUKU_DEFAULT_DBDIR/bookmarks.db, ifBUKU_DEFAULT_DBDIRis defined (first preference), or$XDG_DATA_HOME/buku/bookmarks.db, ifXDG_DATA_HOMEis defined (second preference), or$HOME/.local/share/buku/bookmarks.db, ifHOMEis defined (third preference), or%APPDATA%\buku\bookmarks.db, if you are on Windows andAPPDATAis defined (fourth preference), or- the current directory.
it checks them in that order and takes the first one that applies β no cap. π
- If the URL contains characters like
;,&or brackets they may be interpreted specially by the shell. To avoid it, add the URL within single or double quotes ('/ ").
bestie this is the classic "why did my terminal eat my URL" situation π quote it and move on.
- URLs are unique in DB. The same URL cannot be added twice. periodt.
- Bookmarks with immutable titles are listed with
(L)after the title. π that's your little locked-forever badge. - Tags:
- Comma (
,) is the tag delimiter in DB. A tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted. Tags are stored in lower case and can be replaced, appended or deleted. - Page keywords having a word to comma ratio > 3 are appended to description rather than tags.
- Parent folder (and subfolder) names are converted to all-lowercase tags during bookmarks HTML import.
- Releases prior to v2.7 support both capital and lower cases in tags. From v2.7 all tags are stored in lowercase. An undocumented option
--fixtagsis introduced to modify the older tags. It also fixes another issue where the same tag appears multiple times in the tagset of a record. Runbuku --fixtagsonce. - Tags can be edited from the prompt very easily using
>>(append),>(overwrite) and<<(remove) symbols. The LHS of the operands denotes the indices and ranges of tags to apply (as listed by--tagor keytat prompt) and the RHS denotes the actual DB indices and ranges of the bookmarks to apply the change to.
- Comma (
tl;dr: left side = which tags, right side = which bookmarks. that's the whole redirect agenda. π―
- Update operation:
- If
--title,--tagor--commentis passed without 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.
- Additionally,
--swapallows to modify records order (standalone operation).
- If
- Delete operation:
- 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.
intentional. don't fight the design bestie, it's doing cardio for a reason. πͺ
- Search works in mysterious ways:
- Case-insensitive.
- Matches words in URL, title and tags.
--sany: match any of the keywords in URL, title, description or tags. Default search option.--sall: match all the keywords in URL, title, description or tags.--deep: match substrings (matchmatchesrematched) in URL, title, description and tags.--markers: match each keyword to a specific field, depending on its prefix.--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. - 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. If only one keyword is searched, results will be ordered by DB index, since all matching records will have the same match score.
- Sorting order can be specified (for matches with same amount of matched keywords, if relevant). This option also works with regular printing/export.
spaces matter here!! - and + with the spaces, otherwise you're just searching for a hyphenated tag like a normal person. iykyk. π
- Import:
- Auto-import looks in the default installation path and default user profile.
- URLs starting with
place:,file://andapt:are ignored during import. π - Parent folder (and subfolder) names are automatically imported as tags if
--tacitis used. - Tags are merged even if bookmark URL exists when
--tacitis used. - JSON files exported from browser can be imported. Export to JSON is not supported.
in only. JSON goes in, JSON does not come out. that's the deal. π€
- Encryption is optional and manual. AES256 algorithm is used. To use encryption, the database file should be unlocked (
-k) before using buku and 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.
bestie the file is sitting wide open on your disk in that window. lock it back up when you're done. π«Ά
- Editor support:
- A single bookmark can be edited before adding. The editor can be set using the environment variable EDITOR or by explicitly specifying the editor. The latter takes precedence. 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
EDITORmust 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.
- A single bookmark can be edited before adding. The editor can be set using the environment variable EDITOR or by explicitly specifying the editor. The latter takes precedence. If
β¨ the template order is: URL, title, tags, then everything else as description. don't rearrange it, she's sensitive.
- Proxy support: please refer to the ENVIRONMENT section. π§
- 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. - 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.
- When the argument to
--dbcontains neither.nor directory separator, it's considered a name and is resolved as the matching file with.dbextension within the default DB directory. - When invoked specifically as
buku --db, the program prints out the list of DB names in the default DB directory. - When running Bukuserver (webUI), alternative DB file can be specified via
BUKUSERVER_DB_FILEenvironment variable. Additionally, the Bukuserver runner script supports switching between DB files within the default Buku DB folder. - In the interactive shell mode, the DB command can be used to similarly switch between DB files by name. (You can use non-standard extensions by specifying them, and switch directories by specifying a path β absolute or relative to the current DB.
~.stands for the default database.)
- The option
app-only, bestie. hand-editing this one is a human-error speedrun. ~. = the default database, cute little shorthand. π
β¨ GENERAL OPTIONS β¨
Okay so, general vibes first, bestie. π
-a,--addURL[+|-][tag, ...]β bookmarkURLalong with comma-separated tags. A tag can literally have multiple words. π These tags override fetched tags, unless preceded with+or-.-u,--update[...]β update fields of the bookmarks at specified indices in DB. If no arguments are specified, all titles and descriptions are refreshed from the web. Tags remain untouched. Works with update modifiers for the fieldsurl,title,tagandcomment. If only indices are passed without any edit options, titles and descriptions are fetched and updated (if not empty). Accepts hyphenated ranges and space-separated indices. Updates search results when used with search options, if no arguments. slay β¨-w,--write[editor|index]β edit a bookmark in editor before adding it. To edit and update an existing bookmark, the index should be passed. In this case the environment variableEDITORmust be set. The last record is opened inEDITORifindex=-1. π-d,--delete[...]β delete bookmarks. Accepts space-separated list of indices (e.g.5 6 23 4 110 45) or a single hyphenated range (e.g.100-200). Note that range and list don't work together. Deletes search results when combined with search options, if no arguments. π--retain-orderβ when deleting bookmarks, shift indices of multiple records instead of replacing the deleted record with the last one. iconic π«Ά-v,--versionβ show program version and exit. β-h,--helpβ show program help and exit. πΈ
π¦ EDIT OPTIONS π¦
--url[...]β specify the URL, works with--updateonly. Fetches and updates title if--titleis not used. π₯--tag[+|-][...]β specify comma separated tags, works with--add,--update. Clears the tags, if no arguments passed. Appends or deletes tags, if list of tags is preceded by+or-respectively. π--title[...]β manually specify the title, works with--add,--update. Omits or clears the title, if no arguments passed. β¨-c,--comment[...]β add notes or description of the bookmark, works with--add,--update. Clears the comment, if no arguments passed. π--immutableNβ set the title, description and tags of a bookmark immutable during autorefresh. Works with--add,--update.N=1sets the immutable flag,N=0removes it. If omitted, bookmarks are added withN=0. periodt π--swapNMβ swap two records at specified indices. This is a standalone operation (cannot be invoked along with any other). π
π SEARCH OPTIONS π
-s,--sanykeyword[...]β search bookmarks with ANY of the keyword(s) in URL, title or tags and show the results. Prompts to enter result number to open in browser. Note that the sequential result index is not the DB index. The DB index is shown within[]after the title. This is the default search option for positional arguments if no other search option is specified. π-S,--sallkeyword[...]β search bookmarks with ALL keywords in URL, title or tags and show the results. Behaviour same as--sany. Special keywords:"blank": list entries with empty title/tag"immutable": list entries with locked title
NOTE: To search the keywords, use --sany
--deepβ search modifier to match substrings. Works with--sany,--sall. π--markersβ search modifier to match specific fields based on (optional) prefix markers (i.e. beginning of the keyword):.: search in title>: search in description:: search in URL#: search in tags (comma-separated, partial matches; not affected by--deep)#,: search in tags (comma-separated, exact matches; not affected by--deep)
*: search in all fields (same as no prefix)
-r,--sregexpressionβ scan for a regular expression match. π§-t,--stag[tag [,|+] ...][- tag, ...]β search bookmarks by tags.- Use
,delimiter to find entries matching ANY of the tags - Use
+delimiter to find entries matching ALL of the tags. (Note that the+delimiter must be space separated)
- Use
NOTE: Cannot combine,and+in the same search
- Use
-to exclude bookmarks that match the tags that follow. (Note that the-operator must be space separated). - List all tags alphabetically, if no arguments. The usage count (number of bookmarks having the tag) is shown within first brackets.
-x,--excludekeyword[...]β exclude bookmarks matching the specified keywords. Works with--sany,--sall,--sregand--stag. π--random[N]β output random bookmarks out of the selection (1 unless amount is specified). π²--orderfields[...]β order printed/exported records by the given fields (from DB or JSON) and/ornetloc. You can specify sort direction for each by prepending+/-(default is+). π
π ENCRYPTION OPTIONS π
-l,--lock[N]β encrypt (lock) the DB file withN(> 0, default8) hash passes to generate key. π-k,--unlock[N]β decrypt (unlock) the DB file withN(> 0, default8) hash passes to generate key. π
π POWER OPTIONS π
--aiβ auto-import bookmarks from Firefox, Google Chrome, Chromium, Vivaldi, Brave, and MS Edge browsers. (Firefox profile can be specified using environment variableFIREFOX_PROFILE.) π¦-e,--exportfileβ export bookmarks to Firefox bookmarks formatted HTML. Works with all search options. XBEL is used if file has extension.xbel. Markdown is used if file has extension.md. Markdown format:[title](url), 1 entry per line. Orgfile is used if file has extension.orgOrgfile format:* [[url][title]], 1 entry per line. RSS is used if file has extension.rss/.atomRSS format:<entry>per bookmark with<title>,<link>,<category>,<content>elements A buku database is generated if file has extension.db. π¦-i,--importfileβ import bookmarks from Firefox bookmarks formatted HTML.fileis considered Firefox-exported JSON if it has.jsonextension, XBEL if it is.xbel, Markdown (compliant with--exportformat) if it is.md, Orgfile if the extension is.org, RSS if the extension is.rss/.atomor another buku database if the extension is.db. π₯-p,--print[...]β show details (DB index, URL, title, tags and comment) of bookmark record by DB index. If no arguments, all records with actual index from DB are shown. Accepts hyphenated ranges and space-separated indices. A negative value (introduced for convenience) behaves like thetailutility, e.g.,-nshows the details of the lastnbookmarks. π¨οΈ-f,--formatNβ show selective monochrome output with specific fields. Works with--print. Search results honour the option when used along with--json. Useful for creating batch scripts.N = 1, show only URL.N = 2, show URL and tags in a single line.N = 3, show only title.N = 4, show URL, title and tags in a single line.N = 5, show title and tags in a single line. To omit DB index from printed results, useN0, e.g.,10,20,30,40,50.
-j,--jsonβ output data formatted as JSON, works with--printoutput and search results. π§Ύ--colorsCOLORSβ set output colors. Refer to the COLORS section below for details. π--ncβ disable color output in all messages. Useful on terminals which can't handle ANSI color codes or scripted environments. π«-n,--countNβ number of results to show per page (default10). π’--npβ do not show the prompt, run and exit. π-o,--open[...]β open bookmarks by DB indices or ranges in browser. Open a random index if argument is omitted. π--oaβ open all search results immediately in the browser. Works best with--np. When used along with--updateor--delete, URLs are opened in the browser first and then modified or deleted. π--default-schemeschemeβ when opening a bookmark without a scheme in its URI, use this scheme (defaulthttp). π--replaceoldnewβ replaceoldtag withnewtag if both are passed; deleteoldtag ifnewtag is not specified. π--url-redirectβ when fetching an URL, use the resulting URL from following permanent redirects (when combined with--export, the old URL is included as additional metadata). β©οΈ--tag-redirect[tag]β when fetching an URL that causes permanent redirect, add a tag in specified pattern (usinghttp:{}if not specified). π·οΈ--tag-error[tag]β when fetching an URL that causes an HTTP error, add a tag in specified pattern (usinghttp:{}if not specified). β οΈ--del-error[...]β when fetching an URL causes any (given) HTTP error, delete/do not add it. (Use a parameter like404or400-404,500) ποΈ--export-on[...]β export records affected by the above options, including removed info (requires--updateand--export; specific HTTP response filter can be provided). π€--reorderorder...β update DB indices to match specified order (specified the same way as for--order). π--cachedindex|URLβ browse the latest cached version of the URL at DB index or an independent URL using the Wayback Machine. Useful for viewing the content of bookmarks which are not live any more. π°οΈ--offlineβ add a bookmark without connecting to the web. π΄--suggestβ show a list of similar tags to choose from when adding a new bookmark. π‘--tacitβ show lesser output. Reduces the verbosity of certain operations like add, update etc. π€«--nostdinβ do not attempt to read data from standard input e.g. when the program is not executed from a tty. β¨οΈ--threadsβ maximum number of parallel network connection threads to use during full DB refresh. By default4connections are spawned.Ncan range from1to10. π§΅-Vβ check the latest upstream version available. This is FYI. It is possible the latest upstream released version is still not available in your package manager as the process takes a while. π-g,--debugβ show debug information and additional logs. π
π PROMPT KEYS π
okay bestie this is where buku gets FUN. once you're inside buku's prompt these are the keys that run the whole show π
1-Nβ browse your search results by indices and ranges. yes literally just type numbers, iconic.O [id|range [...]]β try to open search results (or indices, when you're not in a search context) in a GUI browser. With no arguments it toggles try-to-open-urls in a GUI-based browser β even ifBROWSERis set. and why do you care? because toggling is lowkey the move when you're trying to open bookmarks by DB index. π±οΈaβ open ALL the search results in your browser. all of them. no thoughts, head empty, tabs everywhere.s keyword [...]β search for records with ANY keyword.S keyword [...]β search for records with ALL the keywords. capital letter, stricter vibes.dβ toggle deep search, so it matches substrings β like'pen'matching'opened'. sneaky but slay.mβ search with markers β¨ the search string gets split into keywords by prefix markers, and those markers decide which field each keyword gets searched in:'.','>'or':'β title, description or URL'#'/'#,'β tags (comma-separated, partial/full match)'*'β all fields (can be omitted in the 1st keyword)
Note: the tag marker is not affected by d (deep search). fr fr.
v fieldsβ change the sorting order (default is'+index'). you can stack multiple fields, comma- or space-separated.v! fieldsβ same energy but it actually updates the indices in the DB to match the order you specified. permanent. πr expressionβ run a regular expression search. regex girlies rise πt [...]β search bookmarks by a tag. if you give it no arguments it lists every tag, alphabetically.g taglist id|range [...] [>>|>|<<] [record id|range ...]β append, set, or remove specific-or-all tags, by indices and/or ranges, to bookmark indices and/or ranges (peep the EXAMPLES section below for the tea β). if records are omitted, it searches by space-separated taglist id(s) and/or range instead.nβ show the next page of search results.Nβ show the previous page of search results. yes capital N, they're siblings.o id|range [...]β browse bookmarks by indices and/or ranges.p id|range [...]β print bookmarks by indices and/or ranges.w [editor|id]β edit and add or update a bookmark.c idβ copy the url at that search result index to your clipboard. π«ΆDB [name]β with no name it shows you a list of available DBs (aka the files with a'.db'extension sitting in the folder of the current DB). with a name it switches you to that DB. you can drop the file extension ('.db'gets used), and you can hand it a path instead in order to switch a folder (if the path you picked is a folder, the default filename is assumed). if the DB file you named doesn't exist, it gets created. π
Note: you can use '~.' as a shortcut for the default DB.
?β show help on prompt keys. when in doubt, ask the question mark.q,^D, double Enter β exit buku. three separate escape hatches, pick your fighter πͺ
πΈ ENVIRONMENT πΈ
Completion scripts
Shell completion scripts for Bash, Fish and Zsh can be found in:
BROWSER
Overrides the default browser. Refer to:
EDITOR
If it's defined, it gets used as the editor for editing bookmarks with option --write. βοΈ
https_proxy
If it's defined, it gets used to access http and https resources through the configured proxy. Supported format:
GUI integration
buku can be integrated into a GUI environment with simple tweaks. Please refer to:
π COLORS π
buku lets you customize the color scheme with a five-letter string, reminiscent of BSD LSCOLORS. and bestie those five letters represent the colors of:
- index
- title
- URL
- description/comment/note
- tag
respectively. in that exact order, no swapping π
That five-letter string gets passed as the argument to the --colors option, or you can hand it over as the value of the environment variable BUKU_COLORS. either way, same glow-up β¨
The colors/styles available are the ones the manual lays out.
The default colors string is oKlxm, which stands for:
- bright cyan index
- bold bright green title
- bright yellow URL
- normal description
- bright blue tag
and now the fine print, because some terminals are messy:
- Bright colors (implemented as
\x1b[90m-\x1b[97m) may not be available in all color-capable terminal emulators; - Some terminal emulators draw bold text in bright colors instead;
- Some terminal emulators only distinguish between bold and bright colors via a default-off switch.
Please consult the manual of your terminal emulator as well as:
for the details. π
β¨ EXAMPLES β¨
Okay bestie, this is the part where it all clicks. Real commands, real outputs, no gatekeeping. Let's gooo π«Ά
1. Editing and adding a bookmark straight from your editor:
buku -w
buku -w 'gedit -w'
buku -w 'macvim -f' -a https://ddg.gg search engine, privacy
Command one just yoinks the editor out of the EDITOR environment variable. Command two opens gedit in blocking mode. Command three opens macvim with the -f option, and your URL + tags are already sitting pretty in the template. Iconic π
2. Adding a plain little bookmark:
buku --nostdin -a https://github.com/
In the output, > is your url, + is comment, and # is tags. That's the whole legend, memorize it fr.
3. Adding a bookmark with tags search engine and privacy, a comment Search engine with perks, and fetching the page title off the web:
buku -a https://ddg.gg search engine, privacy -c Search engine with perks
Again, output legend: > url, + comment, # tags. Same trio, every time.
4. Adding a bookmark with tags search engine & privacy plus an immutable custom title DDG:
buku -a https://ddg.gg search engine, privacy --title 'DDG' --immutable 1
Heads up bestie: the URL must come before the tags. Not negotiable, that's just how it vibes.
5. Adding a bookmark with no title at all (and yes, this works for update too):
buku -a https://ddg.gg search engine, privacy --title
6. Editing and updating a bookmark via the editor:
buku -w 15012014
This opens up that existing bookmark's details in your editor so you can change whatever you want. The environment variable EDITOR must be set β no editor, no party. π
7. Updating the bookmark at index 15012014 with a new URL, tags and comments, and fetching the title from the web:
buku -u 15012014 --url http://ddg.gg/ --tag web search, utilities -c Private search engine
8. Fetching and updating only the title for the bookmark at 15012014:
buku -u 15012014
9. Updating only the comment for the bookmark at 15012014:
buku -u 15012014 -c this is a new comment
This works the exact same way with --url, --title and --tag too. One field at a time, no drama.
10. Exporting bookmarks tagged tag 1 or tag 2 to HTML, XBEL, Markdown, Orgfile or a whole new database:
buku -e bookmarks.html --stag tag 1, tag 2
buku -e bookmarks.xbel --stag tag 1, tag 2
buku -e bookmarks.md --stag tag 1, tag 2
buku -e bookmarks.org --stag tag 1, tag 2
buku -e bookmarks.db --stag tag 1, tag 2
If you don't opt into any search, then all bookmarks get exported. All of them. The whole stash.
11. Importing bookmarks from HTML, XBEL, Markdown or Orgfile:
buku -i bookmarks.html
buku -i bookmarks.xbel
buku -i bookmarks.md
buku -i bookmarks.db
12. Deleting just the comment for the bookmark at 15012014:
buku -u 15012014 -c
Same deal applies to --title and --tag. But the URL? You can't delete that without deleting the whole bookmark. It's the load-bearing beam of the bookmark, soz. π
13. Updating or refreshing the entire DB with page titles from the web:
buku -u
buku -u --tacit (show only failures and exceptions)
This can update the title or description fields of non-immutable bookmarks by parsing the fetched page. Fields only get updated if the fetched fields are non-empty β no blank overwrites here, we don't do that. Tags stay untouched, periodt.
14. Deleting the bookmark at index 15012014:
buku -d 15012014
The last index gets moved into the deleted index so the DB stays compact β it's giving tidy queen energy. Add --tacit to delete with zero confirmation.
15. Deleting all the bookmarks:
buku -d
16. Deleting a range or a list of bookmarks:
buku -d 100-200
buku -d 100 15 200
17. Searching bookmarks for ANY of the keywords kernel and debugging in URL, title or tags:
buku kernel debugging
buku -s kernel debugging
18. Searching bookmarks with ALL the keywords kernel and debugging in URL, title or tags:
buku -S kernel debugging
19. Searching for bookmarks tagged general kernel concepts:
buku --stag general kernel concepts
20. Searching for bookmarks matching ANY of the tags kernel, debugging, general kernel concepts:
buku --stag kernel, debugging, general kernel concepts
21. Searching for bookmarks matching ALL of the tags kernel, debugging, general kernel concepts:
buku --stag kernel + debugging + general kernel concepts
22. Searching for bookmarks matching any of the keywords hello or world, excluding the keywords real and life, matching both the tags kernel and debugging, but excluding the tags general kernel concepts and books:
buku hello world --exclude real life --stag 'kernel + debugging - general kernel concepts, books'
23. Searching for bookmarks with different tokens for each field, then printing them sorted by the tags (ascending) and URL (descending):
buku --order +tags,-url --markers --sall 'global substring' '.title substring' ':url substring' :https '> description substring' '#partial,tags:' '#,exact,tags' '*another global substring'
24. Listing all unique tags alphabetically:
buku --stag
25. Running a search and updating the results:
buku -s kernel debugging -u --tag + linux kernel
26. Running a search and deleting the results:
buku -s kernel debugging -d
27. Encrypting or decrypting the DB with a custom number of iterations (15) to generate the key:
buku -l 15
buku -k 15
For any one lock & unlock pair, you must specify the same number of iterations. Default is 8 if you just leave it out. Consistency is the vibe, bestie.
28. Showing details of the bookmarks at index 15012014 and the ranges 20-30, 40-50:
buku -p 20-30 15012014 40-50
29. Showing details of the last 10 bookmarks:
buku -p -10
30. Showing all bookmarks with their real index from the database:
buku -p
buku -p | more
31. Replacing tag old tag with new tag:
buku --replace 'old tag' 'new tag'
32. Deleting tag old tag from the DB:
buku --replace 'old tag'
33. Appending (or deleting) tags tag 1, tag 2 to (or from) the existing tags of the bookmark at index 15012014:
buku -u 15012014 --tag + tag 1, tag 2
buku -u 15012014 --tag - tag 1, tag 2
34. Opening the URL at index 15012014 in your browser:
buku -o 15012014
35. Listing bookmarks with no title or tags, just for bookkeeping:
buku -S blank
36. Listing bookmarks with an immutable title:
buku -S immutable
37. Appending and removing tags right at the prompt β taglist index on the left, bookmark index on the right, keep that straight:
// append tags at taglist indices 4 and 6-9 to existing tags in bookmarks at indices 5 and 2-3
buku (? for help) g 4 9-6 >> 5 3-2
// set tags at taglist indices 4 and 6-9 as tags in bookmarks at indices 5 and 2-3
buku (? for help) g 4 9-6 > 5 3-2
// remove all tags from bookmarks at indices 5 and 2-3
buku (? for help) g > 5 3-2
// remove tags at taglist indices 4 and 6-9 from tags in bookmarks at indices 5 and 2-3
buku (? for help) g 4 9-6 << 5 3-2
38. Listing bookmarks with colored output:
$ buku --colors oKlxm -p
aesthetic. π
39. Adding a bookmark after following all permanent redirects, but only if the server doesn't respond with an error (and there's no network failure):
buku --add http://wikipedia.net --url-redirect --del-error
2. Wikipedia
> https://www.wikipedia.org/
+ Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.
40. Adding a bookmark tagged http redirect if the server responds with a permanent redirect, or tagged like http 404 on an error response:
buku --add http://wikipedia.net/notfound --tag-redirect 'http redirect' --tag-error 'http {}'
[ERROR] [404] Not Found
3. Not Found
> http://wikipedia.net/notfound
# http 404,http redirect
41. Updating all bookmarks matching the search β updating the URL if the server responds with a permanent redirect, deleting the bookmark if the server responds with HTTP error 400, 401, 402, 403, 404 or 500, or adding a tag shaped like http:{} for any other HTTP error β then exporting the affected ones into an HTML file, marking deleted records as well as old URLs for those replaced by a redirect:
buku -S ://wikipedia.net -u --url-redirect --tag-error --del-error 400-404,500 --export-on --export backup.html
42. Printing out a single random bookmark:
buku --random
43. Printing out 3 random bookmarks ordered by netloc (reversed), title and url:
buku --random 3 --order ,-netloc,title,+url
44. Printing out a single random bookmark matching the search criteria, and exporting it into a Markdown file (in DB order):
buku --random -S kernel debugging --export random.md
45. Swapping the positions of records #4 and #5:
buku --swap 4 5
46. Updating the indices in all bookmarks to match a specified order:
buku --reorder ,-netloc,title,+url
And that's the whole tour, bestie. 46 examples deep and every single one hits. π
β¨ AUTHOR β¨
Arun Prakash Jana <engineerarun@gmail.com> π
β¨ HOME β¨
β¨ WIKI β¨
https://github.com/jarun/buku/wiki
β¨ REPORTING BUGS β¨
https://github.com/jarun/buku/issues
Found a bug? Tell the maintainers, they're lovely about it, iykyk. π«Ά
β¨ LICENSE β¨
Copyright Β© 2015-2026 Arun Prakash Jana <engineerarun@gmail.com>.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (Yes, that's the all-caps kind of no warranty, take it seriously bestie. π)
And that's a wrap on BUKU(1) β this beauty is Version 5.1, dated 07 Dec 2025, and it's genuinely one of the most useful little tools in your terminal. Go bookmark something. Slay. ππ¦π
π¦ where this page comes from
- ubuntu stonking: buku 5.1.1+ds-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms