Try doing M-. in your shell (Press and hold the Alt key, and then press the period key). Like !$, M-. will give you the last part of the last command entered, but this time you can see it immediately. Better still, you can cycle through all of your commands. Just keep hitting M-. and the shell will display the last part of each command, in order, from newest to oldest.
Note: If you use the ESC key for your 'Meta' key, then you need to release the ESC key each time. Otherwise, if you hold it down and tap the . (period) key, it will return the end of the last command only once, and then start echoing the period after it.
As an example, say you had just finished a
grep fred /etc/passwd
You are ready to use the command line history feature:
vi M-.
Which would expand to (immediately):
vi /etc/passwd
Then, if it looks right, just press Enter.
No comments:
Post a Comment