LoginSignup
6

More than 5 years have passed since last update.

manページ > xxx型構造体のmanページを探す > man -K "struct xxx {"

Last updated at Posted at 2015-02-11

動作確認

CentOS 6.5
man, version 1.6f

コーディングをしている中で、xxx型構造体のメンバ変数を知りたい時がある。例えば、hostent型構造体、pollfd型構造体、epoll_event型構造体それぞれのメンバ変数は何か、など。

ネットがつながっている環境ではgoogle検索する方が早い。

ネットがつながっていない環境では、以下のようにしてmanページを検索することができる。2つのスペースと{があることで、定義を絞り込める。

$ man -K "struct pollfd {"

こうするとしばらくした後

/usr/share/man/man2/poll.2.gz? [ynq]

と表示されるのでyを入力してmanページを開き、

/struct pollfd {
を入力して、メンバ変数の定義に飛ぶことができる。

確認したらqでmanページを抜ける。

その後、再度
/usr/share/man/man2/xxx.xxx.gz? [ynq]
のように聞かれた時はqで中止すればいい。

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
6