Live data from Hacker News

What typing ^D does on Unix (2009)

utcc.utoronto.ca

51–60 of 162 posts

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

#51

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.

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

#52
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.

The button on the keyboard literally says "control" or "ctrl" on it. How could that possibly not be easier to figure out than "^" or "C-"?

C stands for control.

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

#53
post #40
post #25

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

It is also very convenient to remap up/down keys to not just list history, but to do completion based on already typed characters:

    if [[ $- == *i* ]]
    then
        bind '"\e[A": history-search-backward'
        bind '"\e[B": history-search-forward'
    fi
(fix: grammar)

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

#54

^U will clear the buffer - super convenient for retrying botched passwords.

Fun trick: If somebody is watching you type in your login password or SSH pubkey password, spaz wildly on the keyboard, frantically typing random characters, and then hit ^U and type in your real password.

Then you give them a puzzled look once you successfully log in as if nothing out of the ordinary just happened and say something like "What, don't you have a sufficiently complex password?".

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

#56

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 used when talking about text editors a fair bit.

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

#59
post #28

Typing +++ will bring you back out to your modem's firmware, at which point you can issue further AT commands

+++ATH0

How did modems deal with pluses in data? Was there a way to escape the escape sequence, or was there just an ATSnnn or similar sequence to disable escapes?

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

#60
post #28

Typing +++ will bring you back out to your modem's firmware, at which point you can issue further AT commands

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

Post reply on HN