0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Linux】lessで長い行を折り返せずに一行で出力する

0
Last updated at Posted at 2025-12-01

はじめに

Linuxコマンドでlessコマンドを使えば、ログの調査に使えます。lessコマンドを叩くときに、ログが長くなってしまう事もあるでしょう。ただ、一行で出力したいなってときに -Sオプションを使えば、長い行を折り返しせずに一行で出力することができます。

-Sオプション

lessで長い行を一行で出力するには、-Sオプションを使用します。

linux
less -S ファイル名

このようにコマンドを実行すれば、OKです。

また、lessコマンドを実行後に、-Sと入力すれば、一行で出力できます。
出力例は下記です。
スクリーンショット 2025-12-01 22.38.34.png
画面右側に>が表示されました。
スクリーンショット 2025-12-01 22.41.54.png
方向キーの→を押下すれば、右にスクロールできます。

◯エンジニア基礎力を向上させる前に、AIに頼理すぎてませんか?エンジニアとして一生の基礎力がつくおすすめの技術本を紹介しているので、ぜひ要チェックです!
【AIに頼りすぎではないですか?】エンジニア基礎力を底上げするおすすめ技術書まとめ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?