Open a .raw file as text in less
6,273
Solution 1
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.
Solution 2
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.
Related videos on Youtube
Author by
Jonathan Roberts
Updated on September 18, 2022Comments
-
Jonathan Roberts almost 2 years
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?-
Admin about 9 yearstry with strings command: strings file.raw|less
-
Admin about 9 yearsIf I really want to see what's in a file, I use
more
rather thanless
. -
Admin about 9 yearsTo really see what's in a file, I use
od
;-).
-
-
Jonathan Roberts about 9 yearsThis is also great suggestion; if I could accept two answers I would also accept this.
-
Stephen Kitt about 9 yearsUsing 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.