Post History
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 $...
Question
less
#3: Post edited
- 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 ([for example, `.viminfo`](https://powerusers.codidact.com/posts/284577/284581#answer-284581)). **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. For the moment I'm using More, but More is less...
- 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.
#2: Post edited
- Less does not display data files normally, but if it were some sort of Xxd.
- ```
- $ 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 ([for example, `.viminfo`](https://powerusers.codidact.com/posts/284577/284581#answer-284581)). **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. For the moment I'm using More, but More is less...
- 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 ([for example, `.viminfo`](https://powerusers.codidact.com/posts/284577/284581#answer-284581)). **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. For the moment I'm using More, but More is less...
#1: Initial revision
Make Less use a normal view instead of hexdump view
Less does not display data files normally, but if it were some sort of Xxd. ``` $ 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 ([for example, `.viminfo`](https://powerusers.codidact.com/posts/284577/284581#answer-284581)). **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. For the moment I'm using More, but More is less...