Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I write this config file:

# ~/.inputrc
Control-d: "\C-udate +'%F %T'\C-m"

I want to run date command when I type Ctrl-d.
But I cannot override the default behavior(exit).
Thanks for your help.

share|improve this question
up vote 2 down vote accepted

If you do stty -a, you'll notice that Ctrl-D is bound to eof (end of file) for the terminal driver. You would have to unbind it using stty before the Bash binding would have any affect. I wouldn't recommend that you do that. It would be better to choose another keystroke. I use Alt-Shift-D for a similar purpose.

"\eD":"date +%A,\ %B\ %-d,\ %Y,\ %-l:%M:%S\ %p,\ %Z\ \(UTC%z\)"
share|improve this answer

I think that the line discipline trumps readline. Try executing

stty eof undef
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.