Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Let's say I've typed something into the terminal:

Joeterm$egrep " [1-9] " resultsAugmented.txt | egrep -o "20..-..-.." | sort | uniq| grep -c 2010

…but I've not pressed enter yet - I suddenly rememeber that I can't run the command until I first do something else - what are the fastest ways to

  1. blank the prompt without executing the command (I mean, I could leave something heavy on backspace and go and make a cup of tea, but that's not all that efficient)?
  2. Save the command I've typed for later recall, before I then do 1.

I'm looking for least keystrokes ideally…

share|improve this question
    
I would simply open another terminal window/tab, honestly. –  mkaito Apr 4 '12 at 1:23

2 Answers 2

up vote 0 down vote accepted

CtrlU, the default stty kill key, works pretty much everywhere in Unix terminals.

In bash, it will also put the deleted text in the "kill ring", to be inserted later with CtrlY. This does not persist between sessions, however.

share|improve this answer

<Ctrl-a>#<Enter> to go to beginning of the line, comment it and "run" it. It will be saved in your shell's history.

share|improve this answer

Your Answer

 
discard

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.