less shows html files with lynx

Support knowledgebase (less_lynx)
Applies to

SuSE Linux: Version 7.2
This article refers to an older version of SuSE Linux. Therefore some of the informations given in this article may be outdated or the article may contain stale links.

Request:

You want to view HTML files with less. This command however uses the text based browser lynx to show HTML files. But you want to view the source code of the HTML files.

Procedure:

There are two solutions to solve this problem:
  1. First by entering the command
    unset LESSOPEN
    
    you disable this feature until the next logout. But with this setting all files are displayed as "raw" files. e.g. also .gz files.

    If you want to set this option in general you can enter the above mentioned command at the end of the file .profile in your home directory.

    If you want to switch this "meddling" feature on again please type in the following command:

    export LESSOPEN="lessopen.sh %s"
    
  2. You display the source code of a HTML file by starting less like this:
    less < index.html
    
    (Where index.html is the HTML file)

Keywords: LESS, HTML, LYNX

SDB-less_lynx, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 31. Mai 2001
SuSE Linux AG - Last generated: 03. Sep 2001 by ast (sdb_gen 1.40.0)