LoginSignup
221
186

More than 5 years have passed since last update.

さようなら tail -f 。こんにちは less +F

Last updated at Posted at 2015-03-31

元記事は http://www.brianstorti.com/stop-using-tail/ です。

前世紀よりtail -f を愛用してきましたが、とうとうさようならする時がしました。less +F です。

+Fオプションはtail -f のように動きますが、コマンド操作が可能です。

実行してみます。

$ less +F ./README

こんなかんじでtail -f のように動きます。

Hi
This is sample text.

Waiting for data... (interrupt to abort)

Ctrl+Cを入力すると、通常のlessになります。そこでF(大文字のf)を入力するとまたtailモードになってくれます。これが便利。

Macos,Amazon Linux,CentOSでつかえることを確認しました。

元ブログでは複数ファイルをtailしたい場合はtail -f じゃないと出きないということが書いてありましたが、そのような使い方はしたことがないので、less +Fで十分です。 tail -f 今までありがとう。

あとmanは定期的によみなおしがほうがいいのかもしれないと思いました。

221
186
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
221
186