{
    "mode": "man",
    "parameter": "TTY",
    "section": "4",
    "url": "https://www.chedong.com/phpMan.php/man/TTY/4/json",
    "generated": "2026-06-16T06:00:05Z",
    "sections": {
        "NAME": {
            "content": "tty - controlling terminal\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  file  /dev/tty  is a character file with major number 5 and minor number 0, usually with\nmode 0666 and ownership root:tty.  It is a synonym for the controlling terminal of a process,\nif any.\n\nIn addition to the ioctl(2) requests supported by the device that tty refers to, the ioctl(2)\nrequest TIOCNOTTY is supported.\n\nTIOCNOTTY\nDetach the calling process from its controlling terminal.\n\nIf the process is the session leader, then SIGHUP and SIGCONT signals are sent to  the  fore‐\nground process group and all processes in the current session lose their controlling tty.\n\nThis  ioctl(2) call works only on file descriptors connected to /dev/tty.  It is used by dae‐\nmon processes when they are invoked by a user at a terminal.  The process  attempts  to  open\n/dev/tty.   If  the  open  succeeds, it detaches itself from the terminal by using TIOCNOTTY,\nwhile if the open fails, it is obviously not attached to a terminal and does not need to  de‐\ntach itself.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/dev/tty\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "chown(1),  mknod(1),  ioctl(2),  ioctlconsole(2), ioctltty(2), termios(3), ttyS(4), vcs(4),\npty(7), agetty(8), mingetty(8)\n",
            "subsections": []
        },
        "COLOPHON": {
            "content": "This 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                                        2019-03-06                                       TTY(4)",
            "subsections": []
        }
    },
    "summary": "tty - controlling terminal",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "chown",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/chown/1/json"
        },
        {
            "name": "mknod",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mknod/1/json"
        },
        {
            "name": "ioctl",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ioctl/2/json"
        },
        {
            "name": "ioctlconsole",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ioctlconsole/2/json"
        },
        {
            "name": "ioctltty",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ioctltty/2/json"
        },
        {
            "name": "termios",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/termios/3/json"
        },
        {
            "name": "ttyS",
            "section": "4",
            "url": "https://www.chedong.com/phpMan.php/man/ttyS/4/json"
        },
        {
            "name": "vcs",
            "section": "4",
            "url": "https://www.chedong.com/phpMan.php/man/vcs/4/json"
        },
        {
            "name": "pty",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pty/7/json"
        },
        {
            "name": "agetty",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/agetty/8/json"
        },
        {
            "name": "mingetty",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mingetty/8/json"
        }
    ]
}