Jump to content

Wikipedia:Tools/Browser tools/Lynx/Unix Wikipedia in the shell

From Wikipedia, the free encyclopedia

Description

Allows users show a Wikipedia article in the shell using Lynx. Note that these instructions are for Unix operating systems.

Note: This will also work for Links and Elinks.

Instructions

  1. Using the code from the appropriate box under Code...
    • Bash and ksh users, place it in ~/.bashrc.
    • Csh users, place it in ~/.cshrc.
    • Tcsh users, place it in ~/.tcshrc.
  2. Specify the skin (optional)
    • Replace 'useskin=chick' after with 'useskin=YOURSKIN', chick is a pretty good choice for terminals.

Code

See Instructions above. This is for bash and ksh users.
function wp { lynx -dump en.wikipedia.org/wiki/"$*"\?useskin=chick | less; }
See Instructions above. This is for csh and tcsh users.
alias wp "lynx -dump en.wikipedia.org/wiki/\!*\?useskin=chick | less"

By default, Lynx will convert all hyperlinks to footnotes. This feature can be distracting, especially for text with many hyperlinks. To disable hyperlink footnotes, add the option -nolist to the Lynx command-line—e.g.,

function wp { lynx -nolist -dump en.wikipedia.org/wiki/"$*"\?useskin=chick | less; }

One can also search Wikipedia from the commandline using surfraw, which will open up the page in the default or a customized browser.