
表示できない文字である数バイトを含むログ ファイルがいくつかあります (リクエストのバイナリ署名のため)。
少ない量で開けるたびに、こう尋ねられます。
$ less /var/log/file.log
"/var/log/file.log" may be a binary file. See it anyway?
コマンドラインオプションまたは構成を使用して、less でこの手順をスキップするにはどうすればよいですか?
答え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'