Betty: Talk to your Linux

Source: Internet
Author: User
Tags uncompress

Betty: Talk to your Linux

BettyIs an open-source tool for translating English-like phrases into Linux commands. The main purpose of this project is to allow you to use a powerful Linux system by entering a natural language. Let's take a look at how it works.

Install

Betty's installation is very simple and straightforward. First, confirm that you have installed the following dependency packages [LCTT, you need to install at least Ruby1.9 or later].

For Debian-based systems:
sudo apt-get install git curl ruby
For RPM-based systems:
yum install git curl ruby

Now, use the git tool to clone the Betty library to any custom path. Here I cloned it to my home directory,For example,/home/sk/.

git clone https://github.com/pickhardt/betty

Add the alias of betty to your bashrc configuration file.

sudo nano ~/.bashrc

Add the following lines to the end of the file:

alias betty="/home/sk/betty/main.rb"

Make sure that you have set the path of betty correctly.

Now it's time to have a good time with betty.

Usage

You should add the word "betty" before the English phrase [LCTT, You can naturally use your sweetheart name to replace this is not known who's Betty:>]. You may already know that if we want to know our user name in the system, we should run the following command:

whoami

The output is as follows:

sk

As you can see, my current login user name isSkNow I can use the following betty command to get the same result.

betty whats my username

The output is as follows:

Betty: Running whoamisk

Really cool, isn't it? Betty understands the "whats my username" phrase I entered, runs the "whoami" command, and finally outputs the result.

Let's also look at other commands.

If your input is not accurate enough, Betty can respond to you in multiple ways. For example, run the following command:

betty whats my name

Betty is not sure whether she should look for the System user name or the user's full name. In this case, she will ask you multiple questions to find accurate results. As you can see below, Betty asked me which command I want to run whoami or finger $ (whoami) | sed's /.://; Q') [LCTT annotation, you need to have your system installed finger]. I only want to know my user name, so I select a number1.

Betty: Okay, I have multiple ways to respond.Betty: Enter the number of the command you want me to run, or N (no) if you don't want me to run any.[1] whoamiGets your system username.[2] finger $(whoami) | sed 's/.*: *//;q'Gets your full name.1Betty: Running whoamisk
Compressing and decompressing folders

If you want to compress a file or folder, use the following command. For example, I want to compress the "test" folder in my home directory.

betty compress test/ test.tar.gz

The output is as follows:

Betty: Running tar -czvf test.tar.gz test/test/test/home/test/home/sk/test/home/sk/test/test/home/sk/test/sample

Similarly, we can use the following command to decompress an archive file.

betty uncompress test.tar.gz

The output is as follows:

Betty: Running mkdir test &&tar -zxvf test.tar.gz -C testtest/test/home/test/home/sk/test/home/sk/test/test/home/sk/test/sample
Complete Betty command line list

The Betty tool has some command formats. If you enter "what is my user name" instead of "whats my username", it cannot be identified. Therefore, you can only enter the English phrases supported by Betty.

The following shows a complete command line list supported by Betty.

Count:betty how many words are in this directorybetty how many characters are in myfile.pybetty count lines in this folder(Note that there's many ways to say more or less the same thing.)Config:betty change your name to Joebetty speak to mebetty stop speaking to meDatetime:betty what time is itbetty what is todays datebetty what month is itbetty whats todayFind:betty find me all files that contain californiaInternet:betty download http://www.mysite.com/something.tar.gz to something.tar.gzbetty uncompress something.tar.gzbetty unarchive something.tar.gz to somedir(You can use unzip, unarchive, untar, uncompress, and expand interchangeably.)betty compress /path/to/diriTunes:betty mute itunesbetty unmute itunesbetty pause the musicbetty resume itunesbetty stop my musicbetty next songbetty prev trackbetty what song is playing(Note that the words song, track, music, etc. are interchangeable)Fun:betty go crazybetty whats the meaning of life...and more that are left for you to discover!Map:betty show me a map of mountain viewMeta:betty what version are you (or just betty version)betty whats your github againPermissions:betty give me permission to this directorybetty give anotheruser ownership of myfile.txtProcess:betty show me all processes by root containing grepbetty show me all my processes containing netbioSizes:betty show size for myfile.txtSpotify:betty play spotifybetty pause spotifybetty next spotifybetty previous spotifyUser:betty whats my usernamebetty whats my real namebetty whats my ip addressbetty who else is logged inbetty whats my version of rubyWeb queries:betty turn web onbetty please tell me what is the weather like in London

For Linux beginners, Betty seems to be a very nice tool. I hope this tool will be very useful to you.

Cheers!

Source code:

  • Betty Homepage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.