more の場合 1つの画面に内容を表示できるファイルが渡されると、ページを変更せずにファイルの内容をstdoutに書き込むだけです。ファイルが1つの画面に収まらない場合は、 more それをページングします。
少ないコード> 作業中のファイルを1つの画面に表示できる場合は終了するオプションがあります( -F )そして more - -Fと同様に動作するエミュレーション機能 フラグを立てますが、これらのオプションはどちらも lessを引き起こさないようです 内容が1つの画面に収まる場合は、ファイルの内容をstdoutに書き込みます。
どうすればlessを取得できますか ファイルの内容が1つの画面に収まり、通常どおりにファイルをページ分割できる場合は、ファイルの内容をstdoutに書き込みますか?
承認された回答:
less -FXを使用する 。 man lessから :
-F or --quit-if-one-screen
Causes less to automatically exit if the entire file can be dis-
played on the first screen.
-X or --no-init
Disables sending the termcap initialization and deinitialization
strings to the terminal. This is sometimes desirable if the
deinitialization string does something unnecessary, like clear-
ing the screen.