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,677
    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!
     
Loading...
Thread Status:
Not open for further replies.