13

The output of my program has a .raw file extension. If I try to open this with less I get:

No isoinfo available
Install mkisofs to view ISO images

The file isn't an image file, it's just text. Is there a way to tell less that the file should be opened as plain text?

  • 1
    try with strings command: strings file.raw|less – Romeo Ninov Jun 7 '15 at 16:43
  • If I really want to see what's in a file, I use more rather than less. – Mark Jun 8 '15 at 7:10
  • 1
    To really see what's in a file, I use od ;-). – Stephen Kitt Jun 8 '15 at 9:45
20

The attempt to use isoinfo comes from lesspipe, which is generally used as a helper for less via the LESSOPEN variable.

Running

LESSOPEN= less file.raw

will open file.raw without interpretation.

17

Another option which doesn't involve setting any variables is to pipe the data through less instead of letting less open the file for you.

$ cat file.raw | less

or

$ less <file.raw

would do the trick.

  • This is also great suggestion; if I could accept two answers I would also accept this. – user1794469 Jun 7 '15 at 18:37
  • 3
    Using redirections into less has a couple of disadvantages: less needs to buffer everything, so it will use more memory (unless -B is specified); it won't know about the file name, and the size will only be available once it's finished reading all the data. – Stephen Kitt Jun 8 '15 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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