📓

man xxxをコピー/検索する on mac

に公開

macではターミナル上で標準入力をmacOSのクリップボードに保存できるpbcopyというコマンドがあります。
つまり、以下のコマンドでそのコマンドのhelpページをコピーできます。

man tmux | pbcopy

👇なら普通に表示

man tmux | cat

ripgrep(rust ver grep)で検索も

man tmux | rg "kill"

     in the same session.  Once all sessions are killed, tmux exits.
           kill-session
           $ tmux kill-window -t :1
             specified by -s.  The -a option kills all but the client given
             -a is given, all sessions but the specified one is killed.  The
             killed without affecting the others.  The group-name argument may
             window, it is also destroyed.  The -a option kills all but the
             it from any sessions to which it is linked.  The -a option kills
             necessary).  If -k is given and dst-window exists, it is killed,
             in which case any existing command is killed.  -c specifies a new
             given, in which case any existing command is killed.  -c
             The client was killed with SIGTERM.

tmuxとか--helpがなくてmanでしかヘルプ出せないのでパイプ使って表示方法変えようぜってとこです。パイプは最強。

Discussion