I have a quick Ubuntu tip for you today. You’re on the command line and have an image in the directory that you’re currently in. How can you easily view this image without loading Nautilus, browsing to the directory, and opening it from there? It turns out that the answer is very simple.
The default image viewer in Ubuntu is called Eye of Gnome. Using Eye of Gnome, you can quickly view the following images: ani, bmp, gif, ico, jpeg, pcx, png, pnm, ras, svg, tga, tiff, wbmp, xbm, and xpm.
To run Eye of Gnome from the command line, simply run “eog”. So, if you have a file called image.jpg in your current directory, you can simply run the following to view it:
[gaarai@home ~]$ eog image.jpg
Now you never again have to wonder what that image is as you’re browsing around in Terminal.
This tip will work for any distro running Gnome, such as Linux Mint.
Did I help you?
Thanks! Just what I needed.
hi ! do you know any command or tools that show image in virtual console not in gnome-terminal……….
fbi, the Frame Buffer Image viewer, can display images using the kernel’s frame buffer; however, this the program only works in real consoles not virtual consoles. So, you cannot run this while logged in through xterm, gnome-terminal, ssh, screen, etc.
I have yet to find any solution to view images in a virtual terminal.
I’m somehow able to view images in the VT (and videos!), although I’m not sure how. This is on Lubuntu 12.04, automatically brought up through w3m via TTYtter.
FYI That is not true. You can most certainly do this over virtual terminal through mobaxterm, in fact all of the basic image viewers will work.
That’s by tunneling X over SSH, which doesn’t have anything to do with a terminal (virtual or otherwise).
Hey, that’s easy 🙂
Now try this one: Press Ctrl-Alt-F2 (enter virtual terminal) and try viewing image from there 😉 The problem with this is that there’s no X in there, so you’d need a more low-level tool.
The funny thing is that there is such tool for viewing video – mplayer. Amazingly, you can view video from virtual terminal (provided the kernel is booted with appropriate vga=??? option) just as well as you can from X, and noticeably faster on slow machines. But I don’t know of any program that does just the same thing with images. If you know the one, please do reply.
That would be a neat trick. I really don’t have much use for doing that, but I’ll see if I can find something.
Okay, looks like I found the answer. If interested, check out fbida project (http://linux.bytesex.org/fbida/). The fbi program from there can view images from virtual terminal, it’s easy to use and fun ))
Thanks, exactly what i was looking for some BASH programs
Cheers
Thanks, I was looking for that, and found it here.
I was looking for something to display just an image (in fact the part of russian keyboard layout) with no borders and fancy space around. I did not succeeded with eog, but “pqiv” is doing that and is much faster than eog.
That program is indeed fast, but I find it lacking for my uses. pqiv doesn’t allow me to zoom the image in or out, look at other images in the same directory, or much of anything really. I also found an annoying tendency for pqiv’s window to always open in or move to an odd screen on multi-screen setups.
For example, I’ll be working on screen one, but it will open on screen two. I’ll bring it to screen one, but as soon as I click anything, it snaps back to screen two. Frustrating is a nice word for that “feature.”
Yeah. Not for me, but I’m glad that it works for you. Hopefully others will find it useful as well.
jst say
view filename.png/jpeg/jpg
I’m not sure how your system is set up. On my systems,
/usr/bin/view
is a symlink to/etc/alternatives/view
which in turn symlinks to/usr/bin/vim.basic
. Thus, runningview image.jpg
opens up the binary file in vim.To display images in a pseudo-terminal (roxterm, xterm, Gnome-terminal …) you can use w3m, the console-browser/-pager with the w3m-img extension. If no external image-viewer is configured in the w3m-options, an image-file is directly displayed “inline”:
user@machine :~$ w3m /tmp/image.png
And there is another one: Tiv, a perl-script which converts and displays the image as ascii-art. There are many constraints which will produce arbitrary results most of the time, but what can you expect from such a tool…
http://xyne.archlinux.ca/projects/tiv/
I had never seen that before. That is awesome. Thanks for sharing it Pat.
The author of TTYtter also made ppm2ascii which is another perl script to convert images to ASCII art.
thanks for info.. was looking for it .
Excellent.
Lots of thanks for “eog” command. I am on Cent OS and it works here too.
Cool – i’ve just done a new Ubuntu install, and though i’d used things like xv, parts of ImageMagick etc. in the past, none of those cmds worked here — but eog does immediately. Nice — thx Chris! -XG
Thanks Chris….it works on OpenSuse too 🙂
Hi, I want to display an image on second screen while my first screen shall run application. In Fedora it worked with:: display -geometry +1200+200 “imagename”, but not working in Ubuntu. Any command is there Ubuntu…
I just tried that on my system (running 13.10), and it worked just fine. Can you be more specific about what didn’t work?
`xdg-open image.jpg` will open images with the default image viewer on all desktops (eog in ubuntu).
I try it on Ubuntu 16.04 and its works.
thanks a lot
thank you u just saved my half an hour time