Double Press Tab in Terminal for List of Options

I accidentally found a really cool Terminal keyboard shortcut yesterday.  You may already know that Terminal will autocomplete a file name or method name if you press tab after typing a portion of the word.  For example:

Screen Shot 2014-12-31 at 8.14.50 AM

You can see I typed ls to list the files and folders in the current location. Then I started typing cd Fi to change the directory to “FiveMinuteChinese”. As a shortcut I can now press the Tab key, and Terminal will autocomplete the folder name:

Screen Shot 2014-12-31 at 8.18.42 AM

 

Now what I just learned was that if you press the Tab key twice, Terminal will show you a list of possible options. See the screenshot below:

Screen Shot 2014-12-31 at 8.20.18 AM

 

Here I typed cd C, then pressed Tab twice, and Terminal gave me a list of all files or folders that start with the letter “C”. Pretty cool huh? If you’re using irb or another console type environment, you can use this same shortcut to give you a list of possible methods or autocomplete method names.

Hope this is useful!

Advertisements