You are here

How anal am I?

software: 

I just found myself asking me that question. Allright, I am a nerd and I'm fine with that. Allright, I'm very persistent about orderliness and I've come to accept that as a part of my personality. Now, when using the commandline and bash in particular and you've written a command that you decide that you don't want to execute, how do you go about clearing the cli row? Out of the possibilities I know I could choose CTRL+c which would be kinda natural and quite easy to type too. A perfectly fine alternative. But *no*. There's another way to go about it; CTRL+u. A command which tells bash to *erase* to the beginning of the line. I feels alot better. You erase the characters you don't want, no sloppy discard-all-in-one. And it's important to me. Really. I keep my ~/tmp clean with reasonably regular intervals. Really not needed either. These are not the only examples. Randomness and disorder should be the the state which demands the least energy to maintiain, no? Sometimes I wonder from whence the impetus originates...

tweet: 

Comments

There is also ^W which only erases one word. If you like that kind of power.. :)

Yes, I love that kind of power. Didn't know about that one! I have been using Alt + Backspace until now. Will do my best to switch (=

I'm on ZSH, but these should work in Bash as well:

  • Ctrl+K -- delete from the cursor onwards
  • Ctrl+A -- go to start of line (e.g. for the powerful Ctrl+A Ctrl+K combo ;) hehe)
  • Ctrl+E -- go to end of line
  • Ctrl+F -- go forward one character
  • Alt+F -- go forward one "word"
  • Ctrl+B -- go backward one character
  • Alt+B -- go backwards one "word"
  • Ctrl+D -- delete one character
  • Alt+D -- delete one "word"

See the consistency of Ctrl and Alt? I find that very nifty :]

Ctrl+A Ctrl+K combo or Ctrl+E Ctrl+U for another flavor of the same stuff.

Sweet! Thanks! :D