News for hackers. Stuff that matters.
Re:Shell Tricks That Make Life Easier (and Save Your Sanity) by pavel_lishin on Thursday March 26, 2026 @09:59AM (#47530546)
I'm familiar with ctrl-r, but I still very much like the up-arrow behavior described by that commenter.
Re:Shell Tricks That Make Life Easier (and Save Your Sanity) by flir on Thursday March 26, 2026 @11:42AM (#47531892)
Looking at it from a "law of least surprise" angle, it's exactly how it should behave.

"I typed 'cd di↑' and you're giving me 'pwd'??"

Re:Shell Tricks That Make Life Easier (and Save Your Sanity) by dotancohen on Thursday March 26, 2026 @06:38PM (#47536733)
What I love about the default Bash Crtl-C behaviour is that once a command has been located, the bash history is moved to the history of that command, until Enter is pressed.

  $ a
  bash: a: command not found
  $ b
  bash: b: command not found
  $ c
  bash: c: command not found
  $ d
  bash: d: command not found
  $ <CTRL-R> b <UP>
  $ a
That's great if I don't remember which command I was experimenting with, but I do know other commands that I did around that time (usually a file that I edited with VIM).