Betty: tu nueva amiguita en la linea de comandos

por | 15 mayo, 2014

betty-image3

Si quisieramos definir a Betty podríamos decir que es el Siri o Google Now de la linea de comandos, una interfaz amigable que nos facilita ejecutar un buen número de ordenes más o menos complejas sin necesidad de abusar demasiado de nuestra memoria, al tiempo que nos permite realizar busquedas en internet, como puede ser el estado del tiempo o acceso directo a Google Maps.

Betty todavía no reconoce las ordenes de voz, ya que está basada en texto y es necesario escribir en ingles para obtener nuestras respuestas, pero al ser código libre es de esperar que aumenten progresivamente las prestaciones y sea traducido también a otros idiomas.

tar

Algunas de las funciones que están incluidas en su última versión 0.15 son:

  • Descargar archivos de una web
  • Fecha y hora
  • Buscar archivos que contengan una palabra determinada
  • Mostrar el tamaño de un archivo.
  • Acceso a Google Maps
  • Control de Spotify e iTunes
  • Contar el número de caracteres o palabras en un directorio
  • Extraer archivos
  • Cambiar los permisos a un directorio o a un archivo
  • Mostrar quien esta logueado en el sistema
  • Traducción del ingles al español
  • Mostrar las condiciones metereológicas de un determinado lugar
  • Y la última pero no menos importante decirnos cual es el sentido de la vida 🙂 (fan de «El autoestopista galáctico» detected!)

betty-image4

Instalación

1. Primero vamos a resolver algunas dependencias instalando ruby, curl y git (los que ya los tengáis en vuestro sistema ahorraros este paso)

  • En Debian y derivadas como Ubuntu y Linux Mint
sudo apt-get install ruby curl git
  • En Fedora ejecutamos como root
yum install ruby curl git
  • En openSUSE ejecutamos como root
zypper in ruby curl git
  • En Arch y derivadas como Manjaro o Antergos
sudo pacman -S ruby curl git

2. A continuación descargamos la última versión de Betty de GitHub, clonando su repositorio

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

3. Y el último paso es crearle un alias en nuestro archivo /.bashrc

echo "alias betty=\"~/betty/main.rb\"" >> ~/.bashrc
source ~/.bashrc

betty-image5

En la página del proyecto podréis encontrar toda la documentación y lo que se puede hacer con Betty, ahora os dejo con la lista de comandos, organizados por categorías, por si os apetece practicar:

Count
betty how many words are in this directory
betty how many characters are in myfile.py
betty 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 Joe
betty speak to me
betty stop speaking to me

Datetime
betty what time is it
betty what is todays date
betty what month is it
betty whats today

Find
betty find me all files that contain california

Internet
betty download http://www.mysite.com/something.tar.gz to something.tar.gz
betty uncompress something.tar.gz
betty unarchive something.tar.gz to somedir
(You can use unzip, unarchive, untar, uncompress, and expand interchangeably.)
betty compress /path/to/dir

iTunes
betty mute itunes
betty unmute itunes
betty pause the music
betty resume itunes
betty stop my music
betty next song
betty prev track
betty what song is playing
(Note that the words song, track, music, etc. are interchangeable)

Fun
betty go crazy
betty whats the meaning of life
...and more that are left for you to discover!

Map
betty show me a map of mountain view

Meta
betty what version are you (or just betty version)
betty whats your github again

Permissions
betty give me permission to this directory
betty give anotheruser ownership of myfile.txt

Process
betty show me all processes by root containing grep
betty show me all my processes containing netbio

Sizes
betty show size for myfile.txt

Spotify
betty play spotify
betty pause spotify
betty next spotify
betty previous spotify

User
betty whats my username
betty whats my real name
betty whats my ip address
betty who else is logged in
betty whats my version of ruby

Web queries
betty turn web on
betty please tell me what is the weather like in London

Fuente | WepUpd8

Comic | xkcd

10 pensamientos en “Betty: tu nueva amiguita en la linea de comandos

  1. Pingback: Siguiendo la telaraña 19 y 20/2014 en Thalskarth's Maëlstrom

  2. Carlos

    Hola, cuando quiero quiero que toque spotify, me sale un error:

    Betty: Running dbus-send –print-reply –dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause >/dev/null
    Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.mpris.MediaPlayer2.spotify was not provided by any .service files

    Y tambien:

    carlos@werelio_brio:~$ echo «alias betty=\»~/betty/main.rb\»» >> ~/.bashrc
    carlos@werelio_brio:~$ source ~/.bashrc
    bash: alias: source: no se encontró
    bash: alias: /home/carlos/.bashrc: no se encontró
    bash: alias: source: no se encontró
    bash: alias: /home/carlos/.bashrc: no se encontró

    Soy nuevo en linux, y quisiera aprender mas, gracias.

    Responder

Responder a maia101Cancelar respuesta

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.