WEBDUMP(1)
π WEBDUMP(1) β General Commands Manual π
okay bestie, sit down, because we're about to talk about webdump and honestly? it's giving "quiet little utility that does SO much" and i'm obsessed β¨
πΈ NAME πΈ
webdump β convert HTML to plain-text. that's it, that's the whole vibe. HTML goes in, readable text comes out. iconic behavior fr fr π
π SYNOPSIS π
webdump [-8adiIlorx] [-b baseurl] [-s selector] [-u selector]
[-w termwidth]
π¦ DESCRIPTION π¦
so here's the tea: webdump reads UTF-8 HTML data from stdin, converts it, and writes the output as plain-text to stdout. it's literally a little HTML-to-text transformation station and it eats every time π
if the links in your feed are relative URLs, you can hand it a baseurl β but heads up, no cap: that must be an absolute URI π
the options are as follows:
β¨ OPTIONS β¨
-8β use UTF-8 symbols for certain items like bullet items and rulers, so your output is β¨fancierβ¨. aesthetic upgrade, lowkey.-aβ toggle ANSI escape codes. this is what marks up your text with bold, italic, underline, etc. by default it is not enabled.-bbaseurl β base URL of links. it's used to make links absolute. the specified URL is always preferred over the value in a<base/>tag. main character energy: it wins every time π-dβ deduplicate link references. when a duplicate link reference is found, reuse the same link reference number. no repeats, we love a sustainable queen π-iβ toggle whether link reference numbers are displayed inline or not. by default it is not enabled.-Iβ toggle whether URLs for link reference are displayed inline or not. by default it is not enabled. (yes it's a different flag from-i, look at the capitalization bestie, they are NOT twins π)-lβ toggle whether link references are displayed at the bottom or not. by default it is not enabled.-oβ toggle OSC 8 escape sequence to mark inline hyperlinks. by default it is not enabled.
β οΈ okay real talk: this feature can be insecure in some terminals. not me warning you ominously π please know your terminal before you turn this on.
-rβ toggle whether line-wrapping mode is enabled. by default it is not enabled. this uses the terminal width, which you can set with the-woption. wrap it up, literally π-sβ CSS-like selectors. this sets a reader mode to show only content matching the selector. see the section "SELECTOR SYNTAX" for the syntax. you can specify multiple selectors by separating them with a comma. filtering, but make it fashion π§-uβ CSS-like selectors. this sets a reader mode to hide content matching the selector. see the section "SELECTOR SYNTAX" for the syntax. multiple selectors can be specified by separating them with a comma. blocking, but make it elegant π-wtermwidth β the terminal width. the default is77characters. yes, seventy-seven. specific king π-xβ extract and write each resource (such as links and images) to file descriptor 3. the items are output per line in a TAB-separated format. the fields are:type TAB v|h TAB url NEWLINE.vorhindicates a visible or hidden element. side quest unlocked ποΈ
π SELECTOR SYNTAX π
some inspiration was taken from the CSS syntax, but ngl it's more limited. here's the matching rules, and yes they're specific:
- Tag names are matched case-insensitive.
- Classname and ID values are matched case-sensitive.
some examples, because examples are literally the best part:
"main"would match on the"main"tags."#someid"would match on any tag which has theidattribute set to"someid".".someclass"would match on any tag which has theclassattribute set to"someclass"."main#someid"would match on the"main"tag which has theidattribute set to"someid"."main.someclass"would match on the"main"tags which has theclassattribute set to"someclass"."ul li"would match on any"li"tag which also has a parent"ul"tag."li@0"would match on any"li"tag which is also the first child element of its parent container. π note that this differs from filtering on a collection of"li"elements. like, actually different. don't come for me, i'm just the messenger π
π EXIT STATUS π
the webdump utility exits 0 on success, and >0 if an error occurs. simple, clean, communicates. we stan a predictable exit code π«Ά
π EXAMPLES π
one β fetch a webpage using curl(1) and pipe the output to webdump enabling line-wrapping, and write output to the pager less(1):
url='https://codemadness.org/sfeed.html'
curl -s "$url" | webdump -r -b "$url" | less
two β pipe the HTML output to webdump enabling many options (unicode and markup, line-wrapping, link references). transform relative URLs to absolute URLs using the base URL. then pipe it to less(1) with the -R option to enable ANSI escape codes in this pager:
curl -s "$url" | webdump -8 -a -i -l -r -b "$url" | less -R
three β use a simple selector using the -s option to only show content in the "main" tag:
curl -s "$url" | webdump -s 'main' -8 -a -i -l -r -b "$url" | less -R
four β to write resources as TAB-separated lines from file descriptor 3 to a separate file while ignoring the regular standard output:
curl -s "$url" | webdump -x -b "$url" 3>urls >/dev/null
five β to use webdump as a HTML to text filter, for example in the mutt mail client, change in ~/.mailcap:
text/html; webdump -i -l -r < %s; needsterminal; copiousoutput
π₯ SEE ALSO π₯
curl(1), xmllint(1), xmlstarlet(1), ftp(1)
the whole friend group showed up π
π AUTHORS π
Hiltjo Posthuma <hiltjo@codemadness.org> β the mastermind, the moment, the icon π
and that's the whole page bestie!! this one's brought to you by Debian, dated July 15, 2026 β original WEBDUMP(1) energy, general commands manual flavor, now with 100% more sparkle β¨ππ¦
π¦ where this page comes from
- nixpkgs unstable: webdump 0.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms