{
    "content": [
        {
            "type": "text",
            "text": "# pts(4) (man)\n\n**Summary:** ptmx, pts - pseudoterminal master and slave\n\n## See Also\n\n- getpt(3)\n- grantpt(3)\n- ptsname(3)\n- unlockpt(3)\n- pty(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (27 lines)\n- **FILES** (2 lines)\n- **NOTES** (3 lines)\n- **SEE ALSO** (2 lines)\n- **COLOPHON** (7 lines)\n\n## Full Content\n\n### NAME\n\nptmx, pts - pseudoterminal master and slave\n\n### DESCRIPTION\n\nThe  file  /dev/ptmx  (the  pseudoterminal multiplexor device) is a character file with major\nnumber 5 and minor number 2, usually with mode 0666 and ownership root:root.  It is  used  to\ncreate a pseudoterminal master and slave pair.\n\nWhen  a  process opens /dev/ptmx, it gets a file descriptor for a pseudoterminal master and a\npseudoterminal slave device is created in the /dev/pts directory.  Each file  descriptor  ob‐\ntained  by  opening /dev/ptmx is an independent pseudoterminal master with its own associated\nslave, whose path can be found by passing the file descriptor to ptsname(3).\n\nBefore opening the pseudoterminal slave, you  must  pass  the  master's  file  descriptor  to\ngrantpt(3) and unlockpt(3).\n\nOnce  both the pseudoterminal master and slave are open, the slave provides processes with an\ninterface that is identical to that of a real terminal.\n\nData written to the slave is presented on the master file descriptor as input.  Data  written\nto the master is presented to the slave as input.\n\nIn  practice,  pseudoterminals are used for implementing terminal emulators such as xterm(1),\nin which data read from the pseudoterminal master is interpreted by the  application  in  the\nsame way a real terminal would interpret the data, and for implementing remote-login programs\nsuch as sshd(8), in which data read from the pseudoterminal master is sent across the network\nto a client program that is connected to a terminal or terminal emulator.\n\nPseudoterminals can also be used to send input to programs that normally refuse to read input\nfrom pipes (such as su(1), and passwd(1)).\n\n### FILES\n\n/dev/ptmx, /dev/pts/*\n\n### NOTES\n\nThe Linux support for the above (known as UNIX 98 pseudoterminal naming) is  done  using  the\ndevpts filesystem, which should be mounted on /dev/pts.\n\n### SEE ALSO\n\ngetpt(3), grantpt(3), ptsname(3), unlockpt(3), pty(7)\n\n### COLOPHON\n\nThis  page  is  part  of  release  5.10 of the Linux man-pages project.  A description of the\nproject, information about reporting bugs, and the latest version of this page, can be  found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2020-08-13                                       PTS(4)\n\n"
        }
    ],
    "structuredContent": {
        "command": "pts",
        "section": "4",
        "mode": "man",
        "summary": "ptmx, pts - pseudoterminal master and slave",
        "synopsis": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "getpt",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/getpt/3/json"
            },
            {
                "name": "grantpt",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/grantpt/3/json"
            },
            {
                "name": "ptsname",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/ptsname/3/json"
            },
            {
                "name": "unlockpt",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/unlockpt/3/json"
            },
            {
                "name": "pty",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/pty/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}