Поиск нужной man-страницы

Опубликовано mensh - пн, 09/15/2008 - 17:53

Нужно найти программу или утилиту для выполнения конкретной задачи (скажем, для подсчета слов в файле), но вы не знаете, где искать.

Следует провести поиск по ключевым словам командой apropos или man -k.

Выбор команды неважен.

Например, для поиска команды подсчета слов в файле вводим следующую строку:

$ apropos count words
git-count-objects (1) - Count unpacked number of objects and their disk consumption
gnutls_pkcs12_bag_get_count (3) - This function returns the bag`s elements count
gnutls_pkcs7_get_crl_count (3) - This function returns the number of crls in a PKCS7 crl set
gnutls_pkcs7_get_crt_count (3) - This function returns the number of certificates in a PKCS7 certificate set
gnutls_x509_crl_get_crt_count (3) - This function returns the number of revoked certificates in a CRL
ieee1284_ref (3) - modify a port`s reference count
ieee1284_unref [ieee1284_ref] (3) - modify a port`s reference count
ldap_count_entries [ldap_first_entry] (3) - LDAP result entry parsing and counting routines
ldap_count_messages [ldap_first_message] (3) - Stepping through messages in a result chain
ldap_count_references [ldap_first_reference] (3) - Stepping through continuation references in a result chain
ldap_count_values [ldap_get_values] (3) - LDAP attribute value handling routines
ldap_first_entry (3) - LDAP result entry parsing and counting routines
ldap_next_entry [ldap_first_entry] (3) - LDAP result entry parsing and counting routines
llength (n) - Count the number of elements in a list
messages (1) - quick count of messages in mailbox or folder
ndb_select_count (1) - print row counts for NDB tables
nnacct (1m) - news accounting and access authorization (nn)
sa (8) - summarizes accounting information
snmpdelta (1) - Monitor delta differences in SNMP Counter values
sum (1) - checksum and count the blocks in a file
userdel (8) - Delete a user account and related files
usermod (8) - Modify a user account
wc (1) - print newline, word, and byte counts for each file
Tcl_GetIndexFromObj (3) - lookup string in table of keywords
Tcl_GetIndexFromObjStruct [Tcl_GetIndexFromObj] (3) - lookup string in table of keywords
Text::ParseWords (3) - parse text into an array of tokens or array of arrays
bn_add_words [bn_internal] (3) - BIGNUM library internal functions
bn_cmp_words [bn_internal] (3) - BIGNUM library internal functions
bn_div_words [bn_internal] (3) - BIGNUM library internal functions
bn_mul_add_words [bn_internal] (3) - BIGNUM library internal functions
bn_mul_words [bn_internal] (3) - BIGNUM library internal functions
bn_sqr_words [bn_internal] (3) - BIGNUM library internal functions
bn_sub_words [bn_internal] (3) - BIGNUM library internal functions
des_read_2passwords [ui_compat] (3) - Compatibility user interface functions
fontglide (6) - characters float onto the screen to form words
getw (3) - input and output of words (ints)
grpconv [pwconv] (8) - convert to and from shadow passwords and groups
grpunconv [pwconv] (8) - convert to and from shadow passwords and groups
lppasswd (1) - add, change, or delete digest passwords
passwd.nntp [passwd] (5) - passwords for connecting to remote NNTP servers
putw [getw] (3) - input and output of words (ints)
pwconv (8) - convert to and from shadow passwords and groups
pwunconv [pwconv] (8) - convert to and from shadow passwords and groups
sasl_getsecret_t (3) - The SASL callback for secrets (passwords)
shadowconfig (8) - toggle shadow passwords on and off
whatis (1) - search the whatis database for complete words

Из полученного обширного списка выбираем команду wc.

Упомянутые команды выполняют поиск по ключевым словам в секциях DESCRIPTIONman-страниц. Количество искомых слов может быть произвольным, но чем больше слов, тем больше результатов можно получить, потому что команда поочередно ищет каждое слово.