sawyl: (Default)
[personal profile] sawyl
Happened across a few new super-cool bash tricks today. Here are my favourites:

magic-space
This causes bash to substitute C shell-type history escapes when you next type a space. Thus, something cryptic like "ls -l !!:2*" changes to something readable like "ls -l foo bar" before you hit the return key. Seriously useful for preventing history goofs.
M-.
Cycles through the last arguments on previous command lines. Very useful if you do stuff like "ls -l foo" followed by "rm foo" a lot.
M-o
Defined as "\C-p\C-a\M-f ", this goes back to the start of the previous history line, skips over the first word and inserts a space. Perfect for adding extra command line options to the last command.

I also thought the idea of replacing Up and Down with history searches sounded interesting, but I'm not sure how much of a overhead it imposes &mdash performance is already close to glacial on the vector nodes, so I don't really want to do anything that might make it worse. Maybe I'll try it out on my desktop box and see how I get on.

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 4th, 2026 05:08 pm
Powered by Dreamwidth Studios