LoginSignup
44
32

More than 5 years have passed since last update.

便利なtldrコマンド

Posted at

tldrコマンドをMacにインストールしてみました。

tldrはmanコマンドを補完するもので、このプロジェクトのGithubにある説明書きによりますと、tldrとはTL;DRと書き、"Too Long; Didn't Read"という意味だそうで、つまりは「長すぎたんで読まなかった」ということです。manのドキュメントは詳細に書いてあるものが多いですが、言われてみれば説明が冗長すぎて読むのがちょっとしんどいですね。。。基本的な使い方であればまずtldrで調べてみて、それでも不足であればmanを参照するといった使い方がいいのではと思いました。

インストールしてみます。

brew tap tldr-pages/tldr
brew install tldr

試しにgrepコマンドで。

$ tldr grep
 Matches patterns in input text
 Supports simple patterns and regular expressions

 search for an exact string
grep something file_path

 search recursively in current directory for an exact string
grep -r something .

 use a regex
grep -e ^regex$ file_path

 see 3 lines of context
grep -C 3 something file_path

 print the count of matches instead of the matching text
grep -c something file_path

 use the standard input instead of a file
cat file_path | grep something

 invert match for excluding specific strings
grep -v something

おー、わかりやすい。

44
32
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
44
32