Linux.com

Re:i use

Posted by: Anonymous Coward on December 15, 2005 03:46 AM
I'm not the original poster, but you're missing the advantage of this. By grepping for a string from the history, I can look at all the commands at the same time.

www1:~ # history | grep rpm

        8 rpm -q mysql

        9 rpm -q -filesbypkg mysql

      39 ll *rpm

      40 rm *rpm

    208 rm *rpm

    262 rpm -qa >rpms.out

    263 less rpms.out

    266 rpm -qf<nobr> <wbr></nobr>/boot/vmlinuz-2.4.21-297-smp4G

    280 rpm -qf<nobr> <wbr></nobr>/boot/vmlinuz-2.4.21-297-smp4G

    281 rpm --verify k_smp4G-2.4.21-297

    377 rpm -qa

    379 rpm -qa >rpms.out

    401 locate MySQL | grep rpm

    402 rpm -qa | grep -i mysql

    660 rpm -qa | grep -Ei "svn|subversion"

    663 rpm -qf<nobr> <wbr></nobr>/usr/lib/libsvn_wc-1.so

    666 rpm -qf<nobr> <wbr></nobr>/usr/lib/libsvn_wc-1.so.0.0.0

    673 rpm -qf<nobr> <wbr></nobr>/usr/lib/libsvn_delta-1.so.0.0.0

    675 rpm -qf<nobr> <wbr></nobr>/usr/lib/libexpat.a

    932 cp<nobr> <wbr></nobr>./build/rpm/httpd.init<nobr> <wbr></nobr>/etc/init.d/

  1006 history | grep rpm

Then I can run the command I want (e.g., !663) without having to hit Ctrl-R thirty times.

#

Return to CLI Magic: Daily aliases