1
2URLSCAN(1)                  General Commands Manual                 URLSCAN(1)
3
4
5

NAME

7       urlscan - browse the URLs in an email message from a terminal
8

SYNOPSIS

10       urlscan [options] < message
11
12       urlscan [options] message
13
14

DESCRIPTION

16       urlscan accepts a single email message on standard input, then displays
17       a terminal-based list of the URLs in the given  message.   Selecting  a
18       URL  uses  the  Python  webbrowser module to determine which browser to
19       open. The BROWSER environment variable will be used if it is set.
20
21       urlscan is primarily intended to be used with the mutt (1)  mailreader,
22       but it should work well with any terminal-based mail program.
23
24       urlscan is similar to urlview(1), but has the following additional fea‐
25       tures:
26
27       1. Support for more message encodings,  such  as  quoted-printable  and
28       base64.
29
30       2.  Extraction  and display of the context surrounding each URL. Toggle
31       context view on/off with c. Reverse displayed order of URLs with R.
32
33       3. Copy current URL to primary selection with P or to clipboard with C.
34
35       4. URLs are shortened by default to fit on one line. Toggle one or  all
36       shortened URLs with s or S.
37
38       5.  Incremental  case-insensitive  search using /. Footer shows current
39       search term. / again resets search.
40
41       6. Cycle through all available palettes (color and black & white avail‐
42       able  by  default)  using p. Running urlscan -g will generate a ~/.con‐
43       fig/urlscan/config.json file for editing or adding additional pallettes
44       and keybindings. See
45
46       http://urwid.org/manual/displayattributes.html#display-attributes
47
48       for color options and allowed values. Set display width with `--width`.
49
50       7. u will unescape the highlighted URL if necessary.
51
52       8.  Run  a  command  with  the selected URL as the argument or pipe the
53       selected URL to a command using the --run and --pipe arguments.
54
55       9. Use l to cycle through whether URLs are opened using the Python web‐
56       browser  module (default), xdg-open (if installed) or a function passed
57       on the command line with --run. The --run  function  will  respect  the
58       value of --pipe.
59
60       10. F1 shows the help menu.
61
62

OPTIONS

64       -g, --genconf
65              Generate ~/.config/urlscan/config.json with default options.
66
67       -c, --compact
68              Display  a simple list of the extracted URLs, instead of showing
69              the context of each URL. Also toggle with `c`  from  within  the
70              viewer.
71
72       -H, --nohelp
73              Start with header menu hidden.
74
75       -d, --dedupe
76              Remove duplicated URLs from the list of URLs.
77
78       -n, --no-browser
79              Disables the selection interface and print the links to standard
80              output.  Useful for scripting (implies --compact).
81
82       -r, --run <expression>
83              Execute <expression> in place of opening URL with a browser. Use
84              {} in <expression> to substitute in the URL. Examples:
85
86                  $ urlscan --run 'echo {} | xclip -i' file.txt
87                  $ urlscan --run 'tmux set buffer {}'
88
89       -p, --pipe
90              Pipe  the selected URL to the command specified by `--run`. This
91              is preferred when the command supports it, as it is more  secure
92              and tolerant of special characters in the URL. Example:
93
94                  $ urlscan --run 'xclip -i' --pipe file.txt
95
96       -R, --reverse
97              Reverse displayed order of URLs.
98
99       -s, --single
100              Exit urlscan after opening or copying a single browser link.
101
102                  $ urlscan -s file.txt
103
104       -w, --width
105              Set display width.
106
107

MUTT INTEGRATION

109       To  integrate  urlscan with mutt, include the following two commands in
110       ~/.muttrc:
111
112
113       macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to
114       extract URLs out of a message"
115
116       macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "call urlscan to
117       extract URLs out of a message"
118
119
120       Once these lines are in your mutt configuration file, pressing Control-
121       b  will allow you to browse and open the URLs in the currently selected
122       message.
123
124       Alternately, you can pipe a message into urlscan using the  '|'  opera‐
125       tor. This can be useful for applying a different flag (such as the '-d'
126       or '-c' options).
127
128

KEYBINDINGS

130       Run urlscan -g to generate ~/.config/urlscan/config.json.  All  of  the
131       keys  will  be listed. You can either leave in place or delete any that
132       will not be altered.
133
134       To unset a binding, set it equal to "". For example: "P": ""
135
136       The follow actions are supported:
137
138       all_escape -- toggle unescape all URLs (Default: u)
139
140       all_shorten -- toggle shorten all URLs (Default: S)
141
142       bottom -- move cursor to last item (Default: G)
143
144       clear_screen -- redraw screen (Default: Ctrl-l)
145
146       clipboard  --  copy  highlighted  URL  to  clipboard  using  xsel/xclip
147       (Default: C)
148
149       clipboard_pri  --  copy  highlighted  URL  to  primary  selection using
150       xsel/xclip (Default: P)
151
152       context -- show/hide context (Default: c)
153
154       down -- cursor down (Default: j)
155
156       help_menu -- show/hide help menu (Default: F1)
157
158       link_handler -- cycle link handling (webbrowser,  xdg-open  or  custom)
159       (Default: l)
160
161       open_url -- open selected URL (Default: space or enter)
162
163       palette -- cycle through palettes (Default: p)
164
165       quit -- quit (Default: q or Q)
166
167       reverse -- reverse display order (Default: R)
168
169       shorten -- toggle shorten highlighted URL (Default: s)
170
171       top -- move to first list item (Default: g)
172
173       up -- cursor up (Default: k)
174
175

FILES

177       $HOME/.config/urlscan/config.json
178
179       Only required if additional or modified palettes are desired.
180
181

SEE ALSO

183       /usr/share/doc/urlscan/README, urlview(1), mutt(1)
184
185

AUTHOR

187       This  manual  page  was written by Daniel Burrows <dburrows@debian.org>
188       and Scott Hansen <firecat4153@gmail.com>
189
190
191
192                                  15 May 2020                       URLSCAN(1)
Impressum