Professional Documents
Culture Documents
Command sollte
Line:hier
Browsers
stehen
If you’re working at the command line and you need to reach the interactively, or else supply your creden-
tials when you call the browser:
Internet, or if you just want to convert an HTML file into neatly format-
lynx -auth=username:passwordU
ted ASCII text, try a text-based web browser. BY HEIKE JURZIK www.url.de
T
ext-mode surfing may seem like a ies, you can disable the prompt as fol- If you use Lynx to check out local HTML
last resort, but a text-based lows: pages, you can tell the browser not to
browser is sometimes the perfect follow external links when you launch
tool. In this month’s Command Line, lynx -accept_all_cookies (option -localhost). You can also use
you’ll learn about the no-GUI browsers your favorite editor in Lynx. If you tell
Lynx [1], Links [2], and w3m [3]. To make this setting permanent, navi- Lynx that
gate the options dialog with the [Down
Lynx Arrow] key until you find the entry for lynx -editor=vim
You can launch Lynx in a terminal or a Cookies, and then press the [Right
virtual console by typing lynx – if you Arrow] key. In the menu that appears, on launching, you can then press [E] to
prefer, you can pass a URL or the you can select from ignore, ask user load the HTML page you are currently
address of a local HTML file to the (default), and accept all (Figure 1). To viewing in the Vim editor. After quitting
browser when you launch it, e.g.: make sure Lynx does not forget your set- the editor, you automatically return to
tings when you quit the program, you Lynx, where you can reload the page by
lynx www.linux-magazine.com still need to save your changes perma- pressing [Ctrl-R].
nently (before you confirm by clicking To make sure Lynx remembers your
By default, Lynx displays an overview of on Submit or Accept Changes). To do so, favorite editor next time you launch the
common keyboard shortcuts at the bot- check the Save options to disk checkbox browser, press [O] again to access the
tom of the screen. Lynx is completely by pressing the [Enter] key. Lynx stores option dialog, where you can enter the
keyboard controlled. Table 1 shows the user settings in a hidden configuration name of your favorite program in the
most important keyboard shortcuts. file called ~/.lynxrc, which you can Editor box.
You can modify Lynx’s behavior by modify using a text editor.
specifying command line options when You can use the -book option to tell From Lynx to Links
you launch the browser, or by changing Lynx to launch into a view with your The second text browser, Links, gives
the settings in the options dialog, which own personal bookmarks. you keyboard and mouse controls. The
you can call by pressing [O]. If you pre- For password protected pages, either command for launching the browser is
fer not to be prompted to accept Cook- enter your user name and password links – and again you can specify a URL
Figure 1: Using the options dialog to configure Lynx. Figure 2: w3m gives you tabbed browsing.
or a local file. If you press [Esc] or to the clipboard in the normal way – in- only file that you can change using your
click on the top line of the window with stead you have to hold down the [Shift] editor.
your mouse, Links displays a menu, key and drag your mouse over the re- Links renders tables and frames better
which you can navigate using your quired area of text. than Lynx, and you can tell the browser
mouse or keyboard. Keyboard shortcuts The Setup menu allows you to config- how to handle specific file types. For
are assigned to most menu entries, and ure the browser. The Setup menu is example, to display PNG-formatted
it makes sense to learn the shortcuts and where you set up things like the lan- images in the external display program
leave your mouse on your mouse pad. guage, character set, terminal options (which only runs on X Window), first
Table 2 gives you an overview of the (color, cursor etc.), the cache size, and define a file type in Setup / Associations
most common commands. As the mouse so on. Your personal settings are stored / Add. To do so, enter a name in the
is used for program control, you can’t in a file called links.cfg in the hidden ~/ Label field, e.g., PNGs. Set the Type(s) to
simply select an area of text and send it .links folder. Again, links.cfg is a text- image/png, and finally, define the Pro-
W W W. L I N U X - M A G A Z I N E . C O M / N E W S L E T T E R
LINUX USER Command Line: Browsers
add the following entry to your ~/.mail- Then add the path to your own mailcap tell the Lynx browser to ormat the do-
cap file: file to the configuration file ~/.muttrc: cument and call the less pager to dis-
play the document on the screen page
text/html; links %s set mailcap_path = ~/.mailcap by page. ■