
표시할 수 없는 문자(요청의 이진 서명으로 인해)가 포함된 몇 바이트를 포함하는 여러 로그 파일이 있습니다.
적은 금액으로 열 때마다 다음과 같은 질문을 받습니다.
$ less /var/log/file.log
"/var/log/file.log" may be a binary file. See it anyway?
명령줄 옵션이나 구성을 사용하여 이 단계를 덜 건너뛰게 하려면 어떻게 해야 합니까?
답변1
사용 -f
옵션:
-f or --force
Forces non-regular files to be opened. (A non-regular file is a directory or
a device special file.) Also suppresses the warning message when a binary
file is opened. By default, less will refuse to open non-regular files.
Note that some operating systems will not allow directories to be read, even
if -f is set.
LESS
.bashrc의 환경 변수 에 이 옵션을 추가하여 less
기본적으로 -f
.
export LESS='-f'