linux, tips & tricks,

Make your terminal sessions interactive

prince prince Follow Jun 21, 2019 · 2 mins read
Make your terminal sessions interactive
Share this

Sometimes,working with the terminals black & white screen is little boring. Creating new interactive dialog/interactive boxes in our terminal will be little fun and interesting. Here I brought some tools to make the terminal sessions interesting,nteractive dialog boxes in our termial,

  1. dialog
  2. whiptail
  3. zenity

Dialog

It allows us to create interactive screens to make the regular task interesting. you can follow the below to install the dialog command line utility.

For debian/ubuntu users,

sudo apt-get update
sudo apt-get install dialog

CentOS / Redhat users

yum install dialog

Here is a simple example to turn a regular script with interactive screens,

before using dialog – Normal shell script

termial

termial

After using dialog

termial

termial

termial

Find more information on the here

Whiptail

It is a program which allow us to display dialog boxes to the user informational purposes or to get the input from the user.

Here is a simple example on how whiptail works,

whiptail --title "Menu example" --menu "Choose an option" 25 78 16 \
"<-- Back" "Return to the main menu." \
"Add User" "Add a user to the system." \
"Modify User" "Modify an existing user." \
"List Users" "List all users on the system." \
"Add Group" "Add a user group to the system." \
"Modify Group" "Modify a group and its list of members." \
"List Groups" "List all groups on the system."

Whiptail

Find more on the whiptail wikibook here

Zenity:

This is also a wonderful tool which displays GTK+ Dialog Boxes in command line and using shell script. Its speciality is that it allows us to create graphical dialog boxes in th command line to make the interaction between the user and the shell very easy.

Find more on zenity here …

Among these, my personal favourite is dialog and whiptail. Please share your experience with anyother tool other than this, in the comment below.

Join Newsletter
Get the latest news right in your inbox. We never spam!
prince
Written by prince Follow
Author of Genezis. A technical consultant with experience in computer logics, design and development.