How can we reuse those brilliant pieces of (lacking) know how or how can we find them again? You know -that brilliant tip from the guru on that site that you forgot - needless to say you forgot the command itself......but it was something with urpmi
Fear no more the
Code: Select all
history
It will give you the list over all commands executed and in historical order:
It does not care if the command was correct or not - this is the history right or wrong -basta!
Now i find that
hard to remeber so I will just execute it by executing its number in the history table.sudo urpmi --auto-update -a
Like this:
Code: Select all
!991
And wonder of all wonders it is executed directly
Now this can be a bit dangerous because I do not get a peek at the command first - it just executes. And that could potentially
So how do I get to have a look at the command first?
Code: Select all
!991:p
Will do it! By adding the :p (for peek) you can have a look at it first.
To add the previous command you can do a:
Code: Select all
!!
Code: Select all
!-1
Code: Select all
!-2
So to have a peek at three commands back what do we do?
You guessed it:
Code: Select all
!-3:p
But it gets better
I am lousy with numbers and I don't even remember what I did one command back But I know it was starting with sudo urpmi so I do a:
Code: Select all
!sudo urpmi
And there it goes - doing the
Code: Select all
sudo urpmi --auto-update -a
If I want to have a look at the command starting with urpmi?
Code: Select all
!urpmi:p
Or the last command starting with pacman (Arch):
Code: Select all
!pacman:p
You do not even need to remember the entire command. If you want commands executed with ssh and only remember ss just do a:
Code: Select all
!ss:p
It will output something like this;
Code: Select all
$ !ss:p
ssh viking@viking60-server
I just needed to write this down in case I forget