less:検索しますが、特殊文字は無視します。

less:検索しますが、特殊文字は無視します。

大容量ログファイルを表示しようとしています。ログファイルをインポートし、一連のテキスト編集コマンドを介して実行し、フォーマットと色を挿入し、結果をless

これはすべて素晴らしいです!何かを検索したいと思うまで...今はless色のエスケープのために検索語を見つけることができないことがよくあります。

私ができることはありますかless 無視するカラー脱出?

したくない削除する(わたしはわざわざそこに入れるために多くの努力をしました!) 検索目的で無視したいと思います。それでもテキストを色で表示したいです。

どんな提案がありますか?

ベストアンサー1

試してみるか-R切り替え-rます。エスケープを「正しく」解釈するので、色を正しく見ることができます(または想像しても構いません)。

~からless 男性:

   -r or --raw-control-chars
          Causes "raw" control characters to be displayed.  The default is to display control characters using the caret notation; for  example,
          a control-A (octal 001) is displayed as "^A".  Warning: when the -r option is used, less cannot keep track of the actual appearance of
          the screen (since this depends on how the screen responds to each type of control character).   Thus,  various  display  problems  may
          result, such as long lines being split in the wrong place.


   -R or --RAW-CONTROL-CHARS
          Like -r, but only ANSI "color" escape sequences are output in "raw" form.  Unlike -r, the screen appearance is maintained correctly in
          most cases.  ANSI "color" escape sequences are sequences of the form:

               ESC [ ... m

          where the "..." is zero or more color specification characters For the purpose of keeping  track  of  screen  appearance,  ANSI  color
          escape sequences are assumed to not move the cursor.  You can make less think that characters other than "m" can end ANSI color escape
          sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape  sequence.   And
          you  can  make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment
          variable LESSANSIMIDCHARS to the list of characters which can appear.

おすすめ記事