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.

Something has come up which demands me to work only in command line. My primary job is programming (mostly in Fortran and Octave) and I need to display plots.

As a lame example:

I open octave and type ezplot('sin(x)') and it outputs that X11 Display Environment not set and unable to open display. Is there any way for me to view graphics in TTY?

Obviously, I don't expect awesome graphics but I need to see if I am on the right track once a while.

My current algorithm is extremely inefficient. I print -djpeg foo.jpeg and then scp it to my neighboring computer. Borrow that and continue.

share|improve this question
Three obvious questions spring to mind: what OS are you running on your desktop machine? Are you on the system console, or connected remotely? And, if connected remotely, what protocol/software do you use to connect to the remote machine (e.g. SSH using PuTTY)? –  Alexios Jan 24 '12 at 19:51
You actually have two different questions here. Is there any way for me to view graphics in TTY? (answer: aalib or svgalib); and the unstated How can I print graphs to ASCII? (gnuplot, cernlib, etc). Can you clarify what you want rather than how you expect to achieve it? –  dmckee Jan 24 '12 at 20:20
Related to and may be answered in Any (text based) plotting tools in unix toolbox?. –  dmckee Jan 24 '12 at 20:20
A quick google suggests that octave does not support aalib directly and no one cares, there are signs that some people want it to work with svgalib, though I don't know if it actually works. –  dmckee Jan 24 '12 at 20:24

4 Answers 4

up vote 3 down vote accepted

If you simply have a series of .jpeg images that you wish to display in a tty, you can use aview or asciiview. When calling asciiview with an image, it will convert the image to the .pnm format - using an external program like NetPBM or ImageMagic - before passing it to aview for displaying. The .pnm is the ascii image format used to represent the image as set of characters. To view an image in this format, simply use:

$ asciiview foo.jpeg

or to save a .pnm copy first:

$ convert foo.jpeg foo.pnm
$ aview foo.pnm

These support the driver from aalib.

share|improve this answer
None of the other methods word. –  user14517 Jan 25 '12 at 13:39

Can you not run an X server on another tty and switch to it when you need to? If you have a machine next to you that is running X, then you can use X11 forwarding to have it display there.

share|improve this answer
An example of this can be found in this question. –  Emanuel Berg Oct 16 '12 at 22:39

The most direct answer is to use jp2a : JPEG to ASCII.

Maybe you can use the famous ascii-art library : libcaca. It even allows to see movie in a terminal, so it should also works for simple jpeg.

share|improve this answer

For actual graphics your best (and possibly only) bet is svgalib, but be aware that it has nothing in common with X11, so you'll need to write your own replacement for ezplot.

share|improve this answer

Your Answer


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