Useful bash history command shortcuts

Discussion in 'all things UNIX' started by Ocky, Sep 16, 2009.

Thread Status:
Not open for further replies.
  1. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,710
    Location:
    George, S.Africa
    http://maketecheasier.com/mastering-the-bash-history/2009/05/20

    I have found these shortcuts very useful to navigate the bash history. Saves time.

    Something else - for fun. Add this line to the bottom of the .bashrc file :-
    PS1="\`if [ \$? = 0 ]; then echo \[\e[33m\]^_^\[\e[0m\]; else echo \[\e[31m\]O_O\[\e[0m\]; fi\`[\u@\h:\w]\\$ "

    Now when a command is successfully executed, the prompt will show a happy face, and if the command is bad a sad face is shown. :argh:
     
  2. tlu

    tlu Guest

    Nice - thanks for sharing!
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.