It's the default image viewer for Ubuntu, and apparently it's called Eye of Gnome. I would like to be able to launch it from the command line, passing it a file name to open.
34 Answers
The command to use is eog (Eye of GNOME). And you call it like so:
eog filename 1 Use xdg-open:
xdg-open filenamewhich opens a file or URL in the user's preferred application.
Explanation
As long as you use Gnome and eog is your default image viewer, you can use gnome-open:
gnome-open filenameIf you want an alternative that is independent of the desktop environment, use xdg-open which is bash wrapper around environment-specific commands.
For now, xdg-open supports:
- Xfce (
exo-open "$1"), - Gnome (
gvfs-open "$1",gnome-open "$1"with fallback to generic open), - KDE (
kde-open "$1"with fallback tokfmclient exec "$1"), - Mate (
gvfs-open "$1",mate-open $1), - LXDE (
pcmanfm $1with fallback to generic open), - Enlightenment (
enlightenment_open $1), - Cinnamon (
open_gnome3 $1, which isgvfs-open "$1"with fallback to generic open), - Cygwin (
cygstart "$1"), - Darwin (
open "$1").
and tries its luck with other desktop environments (called generics). $1 is your image filename.
Usage
xdg-open filenameIf you want to figure out how xdg-open works, you can read bash source code:
$ locate xdg-open
/usr/bin/xdg-open
/usr/share/man/man1/xdg-open.1.gz
$ less /usr/bin/xdg-openEdit
See also similar answer for different question on unix.stackexchange.com.
For Fedora you can use shotwell filename.
I opened cat.jpg. Then I typed
ps x | grep cat.jpgeog was being used to open my file