What if you want to do a certain task through command line but do not remember or know specifically which command is to be used? Easy, you’ll just Google it. Now, imagine a scenario where you don’t have access to the Internet, and the task you have to do is very high priority and critical (like this)

What will you do then? Thankfully, a tool exists, Betty, that’s built specifically to help you use the Linux command line through natural language input. In this article we will discuss the basics of Betty as well as the features it provides.

Betty

What exactly is Betty? Well, it considers itself to be a “friendly” English-like interface for the Linux command line. With Betty, all you have to do is to put up your query in an English-like phrase, and the tool will translate it to the corresponding command. iOS users can think of Betty as a kind of Siri for the Linux command line.

Download and Install

Downloading and installing Betty isn’t really difficult; all you have to do is to execute the following command: then add the following alias to your ~/.bashrc. Replace [path/to/betty] with the actual path. and finally, run the following command: That’s it. If all the above-mentioned steps are executed successfully, Betty will be installed on your system.

Usage

Suppose you want to find the number of words in a file; you can ask Betty to do this for you by writing the following phrase on the command line: And the tool will do the necessary work. Here’s a working example where Betty found the number of words in a file named “changelog.txt:”

Next up, suppose you want to decompress a .tar.gz file. Here’s how you can ask Betty to do it: Here’s a working example for the same.

Similarly, you can ask the tool to display the current time.

Now, if Betty realizes that there are multiple ways in which it can respond to your query/order, it’ll ask you to select the one you want. Here’s an example for this.

The tool can also bring information from the Web. For example, you can ask it to get the temperature of your city and stuff like that. However, if you’re on a recent Ubuntu version, there’s a little patch that you need to apply before Betty starts responding to the queries that require it to access the Internet. Details on the issue as well as the patch are available here. Sadly, there’s only a limited set of things that Betty can currently do (for a non-exhaustive list, head here), but – as most of you will agree – the tool’s potential is limitless.

Conclusion

Betty is undoubtedly a very handy tool, especially if you’re new to the Linux command line. However, you need to understand that it’s not a magical wand capable of helping you out in any and every situation. The tool is open source, so anybody can customize it or even extend its functionality to make it even more capable. It’s worth giving a try, I’d say. Image credit: IMG_2155