Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I create a message box using command-line to show a text‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌?

share|improve this question
4  
What do you mean by "message box"? A graphic alert box, a popup message box? Something else? –  polym Jul 16 at 18:44

2 Answers 2

up vote 8 down vote accepted

For a standard "box around a message", use boxes:

echo 'This is a test' | boxes

boxes will look like this (First one. Second one is a custom like cowsay):

enter image description here


If you mean an alert box, use notify-send:

notify-send 'title' 'message'

notify-send looks like this:

enter image description here


You also can use zenity for a popup window:

zenity --error --text="An error occurred\!" --title="Warning\!"

Zenity is more graphical and has more options, like having the window appear as q question, using:

zenity --question --text="Do you wish to continue/?"

or even progress bars, using:

find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."

zenity looks like this:

enter image description here


Or use dialog, for a command-line only message box:

dialog --checklist "Choose OS:" 15 40 5 \
1 Linux off \
2 Solaris on \
3 'HP UX' off \
4 AIX off

dialog looks like this:

enter image description here


Another option is whiptail:

whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78

whiptail looks like this:

enter image description here


And if you are truly crazy, use toilet:

toilet -F border -F gay "CRAZY"

toilet looks like this:

enter image description here

share|improve this answer

And then just because @polym's completely over the top answer missed the classic messaging:

write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with echo "message" | write username

write


And the complement to write, wall to send a message to all users

wall

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.