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.
What typing ^D does on Unix (2009)
71–80 of 162 posts
Re: What typing ^D does on Unix (2009)
#72Earlier 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.
On top of that, the shortened 'ctrl' is really a terrible abbreviation. It's not obvious that it stands for 'control' and I would guess that most non-techy people would have no idea that it means this word. Plus, it's near to another key with multiple letters ('alt'). The overall effect is that 'ctrl' appears to just be a jumble of letters with some esoteric meaning. A really odd design decision. Why not just put 'control' on the key and be done with it?
Re: What typing ^D does on Unix (2009)
#73Earlier quoted context omitted.
In readline, ^U will only clear from the cursor to the start of the line, leaving anything on the right. ^K is the converse. I'm not sure you are speaking about readline though. Another very useful thing I use daily is Alt-F/B, to move forward/backward in the line one word at a time. Control does the same, one letter at a time. D will delete an element instead.
There's a lot of unexpected gems in the readline defaults. I recommend people try paging through "bind -p" in bash some time to see what's there. Personal favorites are C-r to search back in history and C-x C-e to edit the current command line in an external editor.
Re: What typing ^D does on Unix (2009)
#74^U will clear the buffer - super convenient for retrying botched passwords.
Re: What typing ^D does on Unix (2009)
#75Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.
Re: What typing ^D does on Unix (2009)
#76Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.
Re: What typing ^D does on Unix (2009)
#77Re: What typing ^D does on Unix (2009)
#78Earlier quoted context omitted.
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.
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…
Re: What typing ^D does on Unix (2009)
#79^U will clear the buffer - super convenient for retrying botched passwords.
Something I use extensively in terminals is ^L and ^M. ^L clear the screen and ^M for a line return.
Re: What typing ^D does on Unix (2009)
#80Earlier quoted context omitted.
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.
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…