So I use the up in my shell (Bash on OSX or Ubuntu, mostly) but some of the time I know that I want the stuff after the cursor's current location. Is there any way to have the line I'm on complete with the line above? Hitting up and then left is annoying.
Any other tricks would be cool too, except for tab, which we all now about :)
Here's an example (per ~quack's request):
I type mkdir /where/the/hell/is/that/thing
and then I want to cd into the same directory. But now I know about meta-b :)
Answer
Try this:
mkdir /where/the/hell/is/that/thing
then press alt+.
depending on your OS and terminal you might have to type esc then .
You can also press alt+1+. to pick a specific prior argument.
This is much better than !! or !$ because you can actually see what you are about to run, and it takes less keystrokes anyway.
edit: strictly speaking it is meta not alt, so it might also work with the "windows" key depending on how your keyboard is setup..
Comments
Post a Comment