Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Make Less use a normal view instead of hexdump view

Post

Make Less use a normal view instead of hexdump view

+4
−0

Less does not display data files normally, but if it were some sort of Xxd.

$ bash --norc
$ export LESS=
$ file -i /var/log/lastlog
/var/log/lastlog: application/octet-stream; charset=binary
$ less -EX /var/log/lastlog
00000000  a3 4c d2 60 74 74 79 32  00 00 00 00 00 00 00 00  |.L.`tty2........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000474a0  ee c7 66 61 74 74 79 31  00 00 00 00 00 00 00 00  |..fatty1........|
000474b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000475c0  00 00 00 00                                       |....|
000475c4

Usually that is a good choice, but some data files are better read as normal text. How can I switch to the normal, plain text view in Less?

I have searched for "binary", "hex" and "xxd" in Less' manual but there does not seem to be a mention of it.


An update just to situate Canina's correct answer.

$ env | grep LESS
LESS=-iRj4
LESSOPEN=|lesspipe %s

lesspipe is a shell script with # Copyright 1999-2020 Gentoo Authors, so it is no surprise that many could not reproduce what I described.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

norepro (2 comments)
What is in your ~/.bashrc? (2 comments)
What is in your ~/.bashrc?
Quintec‭ wrote over 2 years ago

What is in your ~/.bashrc?

Quasímodo‭ wrote over 2 years ago

Quintec‭ Please see edit.