10

I'm have a file called t-0.8.eps.

How can I open this file in the shell?

I am using Mac and when I click .eps files the preview (the name of the software to read PDFs) says failed.

Mikel
  • 56,387
  • 13
  • 130
  • 149
Meva
  • 383
  • 3
  • 5
  • 12

3 Answers3

12

Files with the .eps extension are usually encapsulated postscript. You can view them with gv:

gv t-0.8.eps

Or with your favorite PDF viewer:

evince t-0.8.eps

Or even with an image editor

gimp t-0.8.eps
terdon
  • 234,489
  • 66
  • 447
  • 667
  • Gimp says : Opening '/....../Documents/Gerris Programs/Tutorials/rayleigh-taylor/t-0.8.eps' failed: Unknown file type And I have no evince or gv? – Meva Jan 30 '14 at 14:42
  • 1
    @Meva what operating system are you using? If Linux, which distribution? If Debian/Ubuntu/Mint etc, just run `sudo apt-get install gv` or `sudo apt-get install evince`. Anyway, you should have a pdf viewer installed, try `okular`. If none of these work, please update your question with the output of `file t-0.8.eps`. – terdon Jan 30 '14 at 14:51
  • mac 10.9.1 I am using.I have preview to read pdf files but when I click eps files preview says failed.. – Meva Jan 30 '14 at 15:23
  • 1
    @Meva please **always** include your OS in your questions. Also, show me the output of `file t-0.8.eps` as I requested. Apart from that, you could try [macghostview](https://www.macupdate.com/app/mac/5815/macghostview) available for OSX – terdon Jan 30 '14 at 15:25
  • it says empty when I type file t-0.8.eps – Meva Jan 30 '14 at 15:46
  • 1
    @Meva there you go then, that's the problem. The file is empty which is why it can't be read. – terdon Jan 30 '14 at 15:52
  • So something must be wrong in the software. Maybe uninstalled packages . Thnx – Meva Jan 30 '14 at 15:57
11

In general, you can use open from the terminal to open any file with its default application (see this SO question). open is Mac OS-specific. On GNU/Linux, the equivalent is usually xdg-open.

Also, for your reference, you can try to find out what type of file a file really is (regardless of its extension) using the file command.

Joseph R.
  • 38,849
  • 7
  • 107
  • 143
  • I typed to terminal ...$ file t-0.8.eps and it says t-0.8.eps: empty – Meva Jan 30 '14 at 15:32
  • @Meva This means just what it says: this is an empty file. It seems it was created incorrectly. – Joseph R. Jan 30 '14 at 15:32
  • Won't `open` do exactly the same thing as double clicking the file (which is what the OP did)? – terdon Jan 30 '14 at 15:59
  • @terdon It will. That's exactly the point. The way I read the question, the OP is looking for a way to open files from a terminal the same way they are opened with a double-click. In any case, the actual issue seems to be that the `.eps` file is incorrectly created (see [the OP's comment](http://unix.stackexchange.com/users/57664/meva)) – Joseph R. Jan 30 '14 at 16:03
  • @JosephR. yeah, I know, I reached the same conclusion in the comments to my answer. But the OP states that they already tried clicking and `preview` failed, so `open` will make no difference. – terdon Jan 30 '14 at 16:05
  • @terdon ...which is why I prefaced my answer with "in general": I meant it to be informative for the general problem of "How to open any file from the CLI?". – Joseph R. Jan 30 '14 at 16:30
1

Inkscape can open and edit eps files. It won't fix an empty file though.

Gringo Suave
  • 192
  • 1
  • 7