Live data from Hacker News

What typing ^D does on Unix (2009)

utcc.utoronto.ca

111–120 of 162 posts

Re: What typing ^D does on Unix (2009)

#111

Earlier 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)

#112

Pressing enter then ~. will gracefully shutdown hung ssh sessions

I am amazed by the fact that I never accidentally trigger this feature.

You'd probably trigger it more often if ~/ didn't conveniently map to ~/ - it's quite cleverly designed in a way. Indeed, most of the two-character combinations you're likely to type starting with ~ map to themselves.

Re: What typing ^D does on Unix (2009)

#113

Earlier quoted context omitted.

To be really pedantic (sorry! I'm not complaining about your comment), your keyboard does not have any key labelled 'control', it is always (AFAIK) abbreviated as 'ctrl'. Which is really weird to me, as it's hardly a big word needing abbreviating, and keyboards often have other long words written on the keys ('delete', 'page down', and so on). On top of that, the shortened 'ctrl' is really a terrible abbreviation. It…

You're incorrect, especially for the typical reader here. A good chunk (maybe not over 50%, but its gotta be close) of the regular readers on this site use Macs. Most Mac keyboards, including the ones on the Macbook Pro, spell it out. Same for most non IBM/IBM-PC compatible keyboards.

I'm typing on a mac keyboard too. It has 'ctrl', 'esc', but 'delete' is written in full.

Re: What typing ^D does on Unix (2009)

#114

Neat. 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.

Re: What typing ^D does on Unix (2009)

#115
post #82

Earlier quoted context omitted.

To be really pedantic (sorry! I'm not complaining about your comment), your keyboard does not have any key labelled 'control', it is always (AFAIK) abbreviated as 'ctrl'. Which is really weird to me, as it's hardly a big word needing abbreviating, and keyboards often have other long words written on the keys ('delete', 'page down', and so on). On top of that, the shortened 'ctrl' is really a terrible abbreviation. It…

http://www.clickwithyourmac.com/wp-content/uploads/2014/01/C...

How odd! My mac keyboard is a similar design, but has 'ctrl', and has no writing on the shift keys, caps lock and so on. The only unabbreviated word it has is 'delete'.

Perhaps the standard is something to do with the country (mine is a UK layout).

Re: What typing ^D does on Unix (2009)

#116
post #60
post #28

Earlier quoted context omitted.

+++ATH0

Darnit, I had to dial in again. Kidding of course, but once upon a time many 56k6 modem contained a bug that, upon receiving this in plain text, would cause an actual modem hangup. You could kill hundreds of IRC connections with that one.

It wasn't exactly an unintentional bug - rather one company owned a patent on the technique of enforcing a guard time before and after the attention string to go into command mode (the Hayes '302 patent). They licensed it for $1/modem, but some manufacturers felt that they couldn't afford that.

Re: What typing ^D does on Unix (2009)

#117
post #45
post #43

Earlier quoted context omitted.

^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.

It's not about neutrality, it's about ease of understanding. For me at least, when speaking about something that can be entered into a keyboard ^D is less obvious than Ctrl+D–I need to press the key labeled "control" to issue the proper command, the key labeled "^" will not suffice.

Even then though, why is it obvious that you don't need to press the key labelled + as well?

Re: What typing ^D does on Unix (2009)

#118
post #57

Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.

^\ is actually sigquit, which is a bit different from sigkill, since programs can catch QUIT and perform some cleanup.

SIGQUIT also defaults to dumping core.

Re: What typing ^D does on Unix (2009)

#119

I 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 is the old school way of writing it; you'd see it so much you'd only ever once be confused about it, generally in the very first few days you were learning to use a computer. It's never used anymore, I suppose, except for the old school people who still have enough muscular memory built up to write it that way. I know I do; I learned it from some computer magazine in the 80's and have a hard time letting go.

> It's never used anymore, I suppose, except for the old school people who still have enough muscular memory built up to write it that way. I know I do; I learned it from some computer magazine in the 80's and have a hard time letting go.

I was born after the 80s, and I use that shorthand (although I suppose this probably says more about me than it does about the shorthand itself). I didn't even understand the original comment until I read through the whole thing because I mentally read it as "Ctrl+D"

Re: What typing ^D does on Unix (2009)

#120
post #82

Earlier quoted context omitted.

http://www.clickwithyourmac.com/wp-content/uploads/2014/01/C...

How odd! My mac keyboard is a similar design, but has 'ctrl', and has no writing on the shift keys, caps lock and so on. The only unabbreviated word it has is 'delete'. Perhaps the standard is something to do with the country (mine is a UK layout).

Yes, it does. Not sure why, but:

http://i.imgur.com/vvQNuQX.jpg

Post reply on HN