Mackey's Lab

博士を取るまでの備忘録

tail -f は古い・・・らしい・・・

FUSE デバッグの中で /var/log/system.log を 

# tail -f /var/log/system.log 

で開きっぱなしにすると便利だと言及したが、つい最近 Facebook である記事が回ってきた。

www.brianstorti.com

タイトルは tail -f を使うのをやめよう!というなんとも驚きの内容。
これに関しては日本語のブログ記事も見つかる。日本語に長けている人はこちらを参照すると良いだろう。

「tail -f」を使うのは情弱、情強は「less +F」を使う

どうも「情強」は less +F を利用するらしい。元記事にこんな内容がある。

 

Simply put, it allows you to switch between navigation and watching mode. We all have been there: You are watching a file with tail -f, and then you need to search for something in this file, or just navigate up and down. Now you need to exit tail (or open a new shell), and ack this file or open it with vim to find what you are looking for. After that, you run tail again to continue watching the file. There's no need to do that when you are using less.

 

tail -f だと検索したりするときいちいち閉じて vim で開いてとか面倒だろ?とのこと。うむ確かに。今度からは less +F を利用してみよう。