3 ms·
It's a standard quit command for shells in UNIX – e.g. if you hit ^D in a Bourne shell it will exit as well.
by JimDabell 8y ago
It's a standard quit command for shells in UNIX – e.g. if you hit ^D in a Bourne shell it will exit as well.
- derefr 8y agoIt's not really a "command", though. Unlike, say, Ctrl+C, which becomes a SIGINT signal that the program receives and gets to decide how to handle, Ctrl+D never reaches the program as a separate recognizable thing that you can write a handler for. Instead, Ctrl+D is the way to ask the TTY driver to pass the program an EOF instead of input in response to its next read(2) call to its stdin. It's the same signal that the program would receive if you had been piping input into the program from a file, and that file reached the end. Thus, any CLI program built to handle being piped into, will "automatically" support Ctrl+D as a way to quit out of it.