{
    "content": [
        {
            "type": "text",
            "text": "# lessfile(1) (man)\n\n**Summary:** lessfile, lesspipe - \"input preprocessor\" for  less.\n\n## See Also\n\n- less(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (1 lines) — 1 subsections\n  - lessfile, lesspipe (1 lines)\n- **DESCRIPTION** (18 lines)\n- **USAGE** (8 lines)\n- **FILE TYPE RECOGNITION** (30 lines)\n- **USER DEFINED FILTERS** (26 lines)\n- **FILES** (4 lines)\n- **BUGS** (14 lines)\n- **SEE ALSO** (2 lines)\n- **AUTHOR** (7 lines)\n\n## Full Content\n\n### NAME\n\nlessfile, lesspipe - \"input preprocessor\" for  less.\n\n### SYNOPSIS\n\n#### lessfile, lesspipe\n\n### DESCRIPTION\n\nThis manual page documents briefly the lessfile, and lesspipe commands.  This manual page was\nwritten for the Debian GNU/Linux distribution because the input preprocessor scripts are pro‐\nvided by Debian GNU/Linux and are not part of the original program.\n\nlessfile  and lesspipe are programs that can be used to modify the way the contents of a file\nare displayed in less.  What this means is that less can automatically open up tar files, un‐\ncompress gzipped files, and even display something reasonable for graphics files.\n\nlesspipe  will  toss the contents/info on STDOUT and less will read them as they come across.\nThis means that you do not have to wait for the decoding to finish before less shows you  the\nfile.   This  also means that you will get a 'byte N' instead of an N% as your file position.\nYou can seek to the end and back to get the N% but that means you have to wait for  the  pipe\nto finish.\n\nlessfile  will  toss  the  contents/info  on a file which less will then read.  After you are\ndone, lessfile will then delete the file.  This means that the process has to  finish  before\nyou see it, but you get nice percentages (N%) up front.\n\n### USAGE\n\nJust put one of the following two commands in your login script (e.g.  ~/.bashprofile):\n\neval \"$(lessfile)\"\n\nor\n\neval \"$(lesspipe)\"\n\n### FILE TYPE RECOGNITION\n\nFile  types are recognized by their extensions.  This is a list of currently supported exten‐\nsions (grouped by the programs that handle them):\n\n*.a\n*.arj\n*.tar.bz2\n*.bz\n*.bz2\n*.deb, *.udeb, *.ddeb\n*.doc\n*.egg\n*.gif, *.jpeg, *.jpg, *.pcd, *.png, *.tga, *.tiff, *.tif\n*.iso, *.raw, *.bin\n*.lha, *.lzh\n*.tar.lz, *.tlz\n*.lz\n*.7z\n*.pdf\n*.rar, *.r[0-9][0-9]\n*.rpm\n*.tar.gz, *.tgz, *.tar.z, *.tar.dz\n*.gz, *.z, *.dz\n*.tar\n*.tar.xz, *.xz\n*.whl\n*.jar, *.war, *.xpi, *.zip\n*.zoo\n*.tar.zst, *.tzst\n*.zst\n\n### USER DEFINED FILTERS\n\nIt is possible to extend and overwrite the default lesspipe and lessfile input  processor  if\nyou have specialized requirements. Create an executable program with the name .lessfilter and\nput it into your home directory. This can be a shell script or a binary program.\n\n\nIt is important that this program returns the correct exit code: return 0 if your filter han‐\ndles the input, return 1 if the standard lesspipe/lessfile filter should handle the input.\n\n\nHere is an example script:\n\n#!/bin/sh\n\ncase \"$1\" in\n*.extension)\nextension-handler \"$1\"\n;;\n*)\n# We don't handle this format.\nexit 1\nesac\n\n# No further processing by lesspipe necessary\nexit 0\n\n### FILES\n\n~/.lessfilter\nExecutable  file that can do user defined processing. See section USER DEFINED FILTERS\nfor more information.\n\n### BUGS\n\nSometimes, less does not display the contents file you want to view but output that  is  pro‐\nduced  by  your  login scripts (~/.bashrc or ~/.bashprofile). This happens because less uses\nyour current shell to run the lesspipe filter. Bash first looks for the variable $BASHENV in\nthe  environment expands its value and  uses the expanded value as the name of a file to read\nand execute. If this file produces any output less will display this. A  way  to  solve  this\nproblem is to put the following lines on the top of your login script that produces output:\n\nif [ -z \"$PS1\" ]; then\nexit\nfi\n\nThis  tests  whether  the  prompt variable $PS1 is set and if it isn't (which is the case for\nnon-interactive shells) it will exit the script.\n\n### SEE ALSO\n\nless(1)\n\n### AUTHOR\n\nThis manual page was written by Thomas Schoepf <schoepf@debian.org>, for the Debian GNU/Linux\nsystem (but may be used by others). Most of the text was copied from a description written by\nDarren Stalder <torin@daft.com>.\n\n\n\nLESSOPEN(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "lessfile",
        "section": "1",
        "mode": "man",
        "summary": "lessfile, lesspipe - \"input preprocessor\" for  less.",
        "synopsis": "",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "less",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/less/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "lessfile, lesspipe",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "FILE TYPE RECOGNITION",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "USER DEFINED FILTERS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}