Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Sometimes less wrongly recognize file as binary and tries to show hexdump on LHS (usually ones with non-alphanumeric characters but still containing printable ASCII characters). How to force it to recognize it as text?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

I think you have (or your distribution has) a LESSOPEN filter set up for less. Try the following to tell less to not use the filter:

less -L my_binary_file

For further exploration, also try echo $LESSOPEN. It probably contains the name of a shell script (/usr/bin/lesspipe for me), which you can read through to see what sort of filters there are. Also try man less, and read the Input Preprocessor section.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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