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で長い行を折り返せずに一行で出力する

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
方向キーの→を押下すれば、右にスクロールできます。

もっとlinuxコマンドのlessやgrepについて知りたい場合は、下記の記事を参照してください。
>>>【Linux】less・grepを徹底的に解説!コマンド一覧やコマンド例でわかりやすく

>>>私が運営するブログはこちら。メインは技術ブログですが、副業やポイ活についても紹介!

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?