URLVIEW(1)

NAME
urlview - extract URLs, launch associated program

SYNOPSIS
urlview [-line] [file]…

DESCRIPTION
Scans each file (standard input stream if "-", the default) for URLs, then shows them in a curses(3) menu. (If the standard output stream is not a teletype: writes them, one per line, thereto.)

The menu allows viewing, searching, editing, and opening the URLs in the appropriate program.
URLs are shown in order, but multiple instances of the same URL are deduplicated case-insensitively!

If -line is given, where line is a decimal integer, then the first URL at or following that line is selected automatically, instead of the first.

  Bindings
↓, j, Scroll down
    Select next URL.
↑, k, Scroll up
    Select previous URL.
e   Edit selected URL, confirm with ↵.
↵, ␣
    If EDIT is yes: run e. Then open selected URL with COMMAND or $BROWSER.
Mouse button 1
    Select the URL under the cursor, then ↵.
[0-9]…
    Jump to numbered URL, confirm with ↵. URLs are numbered from 1.
y   Copy selected URL to XSELECTION with xclip(1)/xsel(1)/wl-copy(1).
Mouse button 3
    Select the URL under the cursor, then y.
Home, =
    Select first URL.
End, *, G
    Select last URL.
Page Down, ^F
    Next page.
Page Up, ^B
    Previous page.
/   Enter regex to search URLs forward by; confirm with ↵.
?   Enter regex to search URLs backward by; confirm with ↵.
n   Search URLs forward with saved search (prompt if none).
N   Search URLs backward with saved search (prompt if none).
^L, ^G
    Redraw screen.
q, x, h
    Exit.

Full mutt(1)-style line editing is supported (incl. ^I (Tab) to erase to end of line). During entry, ^G cancels.

ENVIRONMENT
BROWSER
    Overrides the built-in default for COMMAND if not specified in Configuration,
URLVIEW_DEBUG
    Behave as-if the standard output stream weren't a teletype.

FILES
The first extant of ~/.urlview, /etc/urlview/system.urlview is read. In this case, the defaults may be overridden through a simple line-based "setting whitespace value" format. Empty lines and lines starting with ‘#’es are ignored.

  Configuration
REGEXP ere
    Use the specified case-insensitive extended regular expression to match URLs. "\n", "\r", "\t", and "\f" are replaced with the new-line, the carriage return, the horizontal tab, and the form feed, respectively. The default is:
    ((http|https|ftp|gopher|gemini|mailto):(//)?[^ <>"\t]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)[^ .,;\t\n\r<">\):]?[^, <>"\t]*[^ .,;\t\n\r<">\):]

COMMAND prog
    Run shell program, subject to VIA, when an URL is opened.
    prog may contain multiple programs, delimited by ‘:’s; they are tried in order until one exits 0.
    Shadows $BROWSER. Defaults to "/etc/urlview/url_handler.sh".
VIA argument
    Run prog, followed by a space and the quoted URL. If prog contains "%s", that is instead replaced with the quoted URL.
    This may leave the URL visible in to other users in /proc. This is the default.
VIA environment
    Set the URL environment variable to the URL, then run prog verbatim.
VIA pipe
    Run prog verbatim with a line containing the URL piped via the standard input stream.

These two are only useful with VIA=argument:
BROWSER
    Unshadows $BROWSER even if COMMAND is set.
EXPERT
    Allows 's in COMMAND: the URL to be opened is substituted as a quoted word using '. If prog is, for example "w3m '%s' -N", this would defeat this quoting, and run the URL as code. If you're sure your progs don't quote the URL — for example "lynx %s -cookie_file='/tmp/lynx cookies'" — it's safe to enable EXPERT.

EDIT no|yes
    Edit the selected URL before opening it. The default is no.
WRAP no|yes
    When at the last URL, allow ↓ to go to the first, and vice versa. The default is no.
MOUSE yes|no
    Enable mouse support. The default is yes.
XSELECTION buf
    yank (copy) to buf. If $WAYLAND_DISPLAY is set, selects between wl-copy -p if "primary" and wl-copy (clipboard) if anything else. If $DISPLAY is set, given to xclip -selection buf or xsel --buf directly (so the domain is likely primary|secondary|clipboard). The default is primary.

yes, no, argument, environment, and pipe are case-insensitive.

EXIT STATUS
1 if no URLs were found, the effective COMMAND contained a ' and EXPERT wasn't enabled with VIA=argument. WRAP/EDIT/MOUSE/VIA received an invalid value, ere isn't a valid ERE, an unknown setting was specified, or a file couldn't be opened.

SEE ALSO
mutt(1), wl-copy(1), xclip(1), xsel(1), curses(3), regex(7), url(7)