{
    "content": [
        {
            "type": "text",
            "text": "# lesspipe (man)\n\n## NAME\n\nlessfile, lesspipe - \"input preprocessor\" for  less.\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\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION**\n- **USAGE**\n- **FILE TYPE RECOGNITION**\n- **USER DEFINED FILTERS**\n- **FILES**\n- **BUGS**\n- **SEE ALSO**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "lesspipe",
        "section": "",
        "mode": "man",
        "summary": "lessfile, lesspipe - \"input preprocessor\" for  less.",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "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": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "lessfile, lesspipe - \"input preprocessor\" for  less.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "lessfile, lesspipe",
                        "content": ""
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "This 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",
                "subsections": []
            },
            "USAGE": {
                "content": "Just put one of the following two commands in your login script (e.g.  ~/.bashprofile):\n\neval \"$(lessfile)\"\n\nor\n\neval \"$(lesspipe)\"\n",
                "subsections": []
            },
            "FILE TYPE RECOGNITION": {
                "content": "File 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",
                "subsections": []
            },
            "USER DEFINED FILTERS": {
                "content": "It  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",
                "subsections": []
            },
            "FILES": {
                "content": "~/.lessfilter\nExecutable file that can do user defined processing. See section USER DEFINED  FILTERS\nfor more information.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Sometimes,  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",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "less(1)\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "This 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\nLESSOPEN(1)",
                "subsections": []
            }
        }
    }
}