Making your own commands!
Posted: 09 Nov 2011, 01:36
We have those brilliant gurus here and they often help me with brilliant solutions. At that moment i am on top of the world and the next time it happens, and I need that brilliant command again I ......have.....forgotten it
I know it is only me, but the only way for me is to write it down here and hope that I come across it later, so here we go:
One brilliant RPM command is It shows what you installed when nicely sorted by time and date with the latest installation on top.
This way you can check what that last auto-update put on your box. Or if you are like me, what you yourself put on the box last. I use it a lot in Mandriva.
Well.... if I can remember it,
If not: I come here to the tip section and find it nicely documented - and my problem is solved.
But there has to be a better way!
Imagine if I could make a two letter command like li for "last installed" out of that? What a dream!
....Although we fix the impossible immediately here - dreams take somewhat longer, but here we go:
Now I only have to open a terminal and write li
You can do this with pretty much any command if you always make a typo on ls you can do a
After that both commands will work.
.....Until you end the session or until you do a
You can play around with it and automate the command you need and put it in:
~/.bashrc
Like so:
alias li="rpm -qa --last | less"
alias sl=ls
After you have added those lines they will work forever.
Nice isn't it?
I know it is only me, but the only way for me is to write it down here and hope that I come across it later, so here we go:
One brilliant RPM command is
Code: Select all
rpm -qa --last | less This way you can check what that last auto-update put on your box. Or if you are like me, what you yourself put on the box last. I use it a lot in Mandriva.
Well.... if I can remember it,
If not: I come here to the tip section and find it nicely documented - and my problem is solved.
But there has to be a better way!
Imagine if I could make a two letter command like li for "last installed" out of that? What a dream!
....Although we fix the impossible immediately here - dreams take somewhat longer, but here we go:
Code: Select all
alias li="rpm -qa --last | less"Now I only have to open a terminal and write li
You can do this with pretty much any command if you always make a typo on ls you can do a
Code: Select all
alias sl=lsAfter that both commands will work.
.....Until you end the session or until you do a
Code: Select all
unalias slYou can play around with it and automate the command you need and put it in:
~/.bashrc
Like so:
alias li="rpm -qa --last | less"
alias sl=ls
After you have added those lines they will work forever.
Nice isn't it?
Very nice.
I will definitely steal this one!