'less'コマンドを使用しているときに、ターミナルに表示されているものをファイルにリダイレクトするにはどうすればよいですか?

αғsнιη

lessを押しQて終了するまで、ターミナルコンテンツ(現在ファイル全体ではないコンテンツ)を出力ファイルにリダイレクトするにはどうすればよいlessですか?

シルヴァン・ピノー

ターミナルに現在表示されているセクションだけを保存するには、|コマンドを使用できます

差出人man less

| <m> shell-command
      <m>  represents any mark letter. Pipes a section of the input file to the given
  shell command. The section of the file to be piped is between the first line on the
  current screen and the position marked by the letter. <m> may also be '^' or '$' to
  indicate beginning or end of file respectively.
  If <m> is '.' or newline, the current screen is piped.
  1. したがって、最初のタイプ|(パイプ記号)
  2. 次に、.マークを選択して、端末に表示されているものだけを選択します(または単に押しますEnter
  3. teeファイルに保存するために使用します。例:tee /tmp/section_of_big_file.txt
  4. Enter次に押すq

スクリーンショット付きのシーケンス:

ここに画像の説明を入力してください

ここに画像の説明を入力してください

ここに画像の説明を入力してください

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Related 関連記事

ホットタグ

アーカイブ