Wednesday 24 April 2013

Supercharge Your Command Line's History Search with Four Lines of Code


OS X and Linux: Pressing the up and down arrow lets you step through your history in the command line, but sometimes it can take awhile to get your way to the command you want. Jude Robinson, posting on Coder Wall, shares four lines of code that make your search much faster.

With four lines, you'll be able to type the beginning of the command (e.g. "cd") and press the up arrow to see the most recent command containing the text you typed (e.g "cd ~/Library"). This makes it much easier to find what you're looking for. To make this happen, create a text file called .inputrc in your home folder and put the following four lines inside:

"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

Once you do, open up your favorite Terminal Emulator (here are our favorites for OS X and Linux) and give a try.

The single most useful thing in bash | Coder Wall

Source: http://feeds.gawker.com/~r/lifehacker/full/~3/Ql2wAi7Ht2Q/supercharge-your-command-lines-history-search-with-fou-478683529

power ball livan hernandez soledad o brien mega ball lottery winner lottery numbers mega millions lottery

No comments:

Post a Comment