Freelancer's Playground! New knowledges every now and then

20Aug/082

Using Bash’s Command History

Are you a linux user? do you frequently use BASH shell? If yes, then here's some bash trick you could use to raise your productivity.
First trick is, the use of CTRL+R. You can search your history using this shortcut.
Just type the command you want and press ENTER when you found it, or press right arrow to change current selected command.

silent@hacked:~$
(reverse-i-search)`mang': ls -l /media/MIX/manga/bleach/

Second trick is how to execute previous command again and again. You can do this by using the one of the following trick:

  • Press Up Arrow or type !! to select previous command and press ENTER.
  • Press !-N, where N is number to select last N history and execute it.
    Eg: !-3 will execute your last 3 history and !-1 will execute your last history. !-1 is equal to !! or Up arrow.

That's it for now. I'll cover more trick in another posting. So, stay tune.

  • http://zulfikars.org/ Fikar

    Pake perintah “history” jg bisa kan pak ?

    silent:Bisa lah, tapi kan history untuk melihat history command. Kalo yang ini, gimana menggunakan history tersebut.

  • http://zulfikars.org Fikar

    Pake perintah “history” jg bisa kan pak ?

    silent:

    Bisa lah, tapi kan history untuk melihat history command. Kalo yang ini, gimana menggunakan history tersebut.