Earlier quoted context omitted.
... There's a program called SSH to get to another CPU. Tilde is the escape, it's doubled to send it through, And "quit" is tilde-. I think you know how the rest goes...
What does this reference?
What typing ^D does on Unix (2009)
151–160 of 162 posts
Re: What typing ^D does on Unix (2009)
#152Re: What typing ^D does on Unix (2009)
#153I wish articles like this would say what ^D means. I remember when I was new to Unix it took me a while to realize that I wasn't supposed to type a literal caret (^) followed by a D. For reference it means Ctrl+D, unless you you have a strange keyboard from Sun or something.
^D, Ctrl+D and C-d are all different ways of saying the same thing. There's nothing particularly neutral about Ctrl+D, any more than there is about using the word 'water' to mean the substance of which the oceans are mostly comprised — it's just another dialect's term.
Right, and the classic book The Unix Programming Environment (by Brian Kernighan and Rob Pike) uses ctl-d.
Re: What typing ^D does on Unix (2009)
#154Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.
https://en.wikipedia.org/wiki/Control-%5C
https://en.wikipedia.org/wiki/Core_dump
https://en.wikipedia.org/wiki/Control-C
I remember doing:
sdb a.out . core
or something like that, in my C-on-Unix programming days earlier :)
sdb was a debugger.
Re: What typing ^D does on Unix (2009)
#155Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.
IIRC, on Unix, Ctrl-\ sends the quit signal, which causes the process receiving it to do a core dump (before exiting), which can be used for post-mortem debugging, whereas Ctrl-C sends the kill signal, which makes the process terminate without any core dump. Those are the default actions for the signals. https://en.wikipedia.org/wiki/Control-%5C https://en.wikipedia.org/wiki/Core_dump https://en.wikipedia.org/wiki/Co…
UNIX one-liner to kill a hanging Firefox process:
http://jugad2.blogspot.in/2008/09/unix-one-liner-to-kill-han...
Some interesting comments on that post too, which go into slightly deeper details.
Re: What typing ^D does on Unix (2009)
#156Earlier quoted context omitted.
For the vi-adherents out there, `set -o vi` will let you navigate your prompt and history with vi-like keybindings. I'm amazed by how many vi users don't know this.
I'm amazed by how many people still run bash!
Re: What typing ^D does on Unix (2009)
#157^U will clear the buffer - super convenient for retrying botched passwords.
Re: What typing ^D does on Unix (2009)
#158Neat. So when my terminal is spewing output because I ran "cat massivefile" instead of "cat massivefile | head", I can hit ctrl-D to stop it instead of repeatedly hitting ctrl-C and despairing.
No, thats what ctrl-s and ctrl-q are for. Here's the rest in one place: eof VEOF EOF character eol VEOL EOL character eol2 VEOL2 EOL2 character erase VERASE ERASE character erase2 VERASE2 ERASE2 character werase VWERASE WERASE character intr VINTR INTR character kill VKILL KILL character quit VQUIT QUIT character susp VSUSP SUSP character start VSTART START character stop VSTOP STOP character dsusp VDSUSP DSUSP chara…
Re: What typing ^D does on Unix (2009)
#159Neat. So when my terminal is spewing output because I ran "cat massivefile" instead of "cat massivefile | head", I can hit ctrl-D to stop it instead of repeatedly hitting ctrl-C and despairing.
Also, a side note, I would rather just run "head massivefile" or even better "less massivefile" (because, most probably I'd want to see past what head shows by default). Running cat and then piping it to another program is inefficient, 2 forks + pipe.
sed nq file
where n is some positive integer, to print the first n lines of the file.
Also, body (the complement of head and tail :)
# body
sed -n $1,$2p $3
Re: What typing ^D does on Unix (2009)
#160Earlier quoted context omitted.
As the article explained at the end, shells put the terminal into uninterpreted mode, so ^D doesn't do anything special there. You have to be using a program (such as cat) that doesn't do this to see ^D's behavior.
Shells that want to implement features like tab completion or more elaborate line editing than the basics, which only provide for deleting the last character, word, or line (using Backspace/^W/^U) need to put the terminal into raw mode when reading the user's command line so they can bypass the basic line editing that the terminal provides (called "cooked mode"). However, you can write a shell that doesn't do this. I…