Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the apropos command in Linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly describes how to use apropos command in Linux, the article is very detailed, has a certain reference value, interested friends must read it!

apropos is a command in LINUX that locates the name and description of a manual page by keyword. This is equivalent to using the man command with the-k option

The apropos command looks up keywords in certain database files that contain short descriptions of system commands and sends the results to standard output.

If you don't know the name of the command you need to complete a particular task, you can search for it using a keyword through the Linux apropos utility. The utility searches for keywords and displays short descriptions of all man pages that contain matches. Also, using the man utility and the-k (keyword) option, you get the same results (actually the same commands) as using the Linux apropos utility.

syntax apropos [-dalhvV] -e|-[w|-r] [-s section] [-m system[,...]] [-M path] [-L locale] -C [file] keyword ... Option-d, --debug: Output debug information. -v, --verbose: outputs detailed warning messages. -r, -- regex: Interpret each keyword as a regular expression. This is the default behavior. Each keyword will match the man page and description. -w, --wildcard: Interprets each keyword as a shell-style wildcard. -e, --exact: Each keyword will exactly match the man page name and description. -a, --and: Displays only man pages and descriptions that match all keywords. Items matching any keyword are displayed by default. -l, --long: Does not reduce output according to terminal width. -s section, --section: Find only the specified manual section. -m system[,...], --systems=system[,...]:Manual pages for finding other operating systems. -M path, --manpath=path: Specifies to look up from other colon-separated man page hierarchies. The default is the $MANPATH environment variable. This option overrides $MANPATH. -L locale, --locale=locale: apropos calls the C function setlocale to get the current localization information, including $LC_MESSAGE and $LANG. Use this option to provide a locale string to temporarily change localization information. -C file, --config-file=file: Use this user profile instead of the default ~/.manpath. -h, --help: Print help and exit. -V, --version: Print version information and exit. A return value of 0 indicates success, 1 indicates a usage, syntax, or profile error, 2 indicates an operational error, and 16 indicates no match found.

Example [root@localhost ~]# man -k who at.allow [at] (5) - determine who can submit jobs via at or batch at.deny [at] (5) - determine who can submit jobs via at or batch jwhois (1) - client for the whois service jwhois (rpm) - Internet whois/nicname client. Net::LDAP::Extension::whoami (3pm) - LDAP Who am I? Operation w (1) - Show who is logged on and what they are doing who (1p) - display who is on the system who (1) - show who is logged on whoami (1) - print effective userid [root@localhost ~]# apropos who at.allow [at] (5) - determine who can submit jobs via at or batch at.deny [at] (5) - determine who can submit jobs via at or batch jwhois (1) - client for the whois service jwhois (rpm) - Internet whois/nicname client. Net::LDAP::Extension::WhoAmI (3pm) - LDAP Who am I? Operation w (1) - Show who is logged on and what they are doing who (1p) - display who is on the system who (1) - show who is logged on whoami (1)- print effective userid Find man pages with emacs and vi in their name and description:

apropos -a emacs vi Above is "How to use apropos command in Linux" All the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report