URLSCAN(1) | General Commands Manual | URLSCAN(1) |
urlscan - browse the URLs in an email message from a terminal
urlscan [options] < message
urlscan [options] message
urlscan accepts a single email message on standard input, then displays a terminal-based list of the URLs in the given message. Selecting a URL uses the Python webbrowser module to determine which browser to open. The BROWSER environment variable will be used if it is set.
urlscan is primarily intended to be used with the mutt (1) mailreader, but it should work well with any terminal-based mail program.
urlscan is similar to urlview(1), but has the following additional features:
1. Support for more message encodings, such as quoted-printable and base64.
2. Extraction and display of the context surrounding each URL. Toggle context view on/off with c. Reverse displayed order of URLs with R.
3. Copy current URL to primary selection with P or to clipboard with C.
4. URLs are shortened by default to fit on one line. Toggle one or all shortened URLs with s or S.
5. Incremental case-insensitive search using /. Footer shows current search term. / again resets search.
6. Cycle through all available palettes (color and black & white available by default) using p. Running urlscan -g will generate a ~/.config/urlscan/config.json file for editing or adding additional pallettes and keybindings. See
http://urwid.org/manual/displayattributes.html#display-attributes
for color options and allowed values. Set display width with `--width`.
7. u will unescape the highlighted URL if necessary.
8. Run a command with the selected URL as the argument or pipe the selected URL to a command using the --run-safe, --run and --pipe arguments.
9. Use l to cycle through whether URLs are opened using the Python webbrowser module (default), xdg-open (if installed) or a function passed on the command line with --run-safe or --run. The --run and --run-safe functions will respect the value of --pipe.
10. F1 shows the help menu.
11. Scan certain email headers for URLs. Currently Link, Archived-At and List-* are scanned when --headers is passed.
12. Queue multiple URLs for opening and open them all at once with a and o.
$ urlscan --regex 'https?://.+.216
$ urlscan --run-safe 'tmux set buffer {}'
$ urlscan --run-safe 'xclip -i' --pipe file.txt
$ urlscan --run 'echo {} | xclip -i' file.txt
$ urlscan -s file.txt
To integrate urlscan with mutt, include the following two commands in ~/.muttrc:
macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "call urlscan to extract URLs out of a message"
Once these lines are in your mutt configuration file, pressing Control-b will allow you to browse and open the URLs in the currently selected message.
Alternately, you can pipe a message into urlscan using the '|' operator. This can be useful for applying a different flag (such as the '-d' or '-c' options).
Run urlscan -g to generate ~/.config/urlscan/config.json. All of the keys will be listed. You can either leave in place or delete any that will not be altered.
To unset a binding, set it equal to "". For example: "P": ""
The follow actions are supported:
$HOME/.config/urlscan/config.json
Only required if additional or modified palettes or keybindings are desired.
/usr/share/doc/urlscan/README, urlview(1), mutt(1)
This manual page was written by Daniel Burrows <dburrows@debian.org> and Scott Hansen <firecat4153@gmail.com>
6 March 2021 |