Monday, September 19, 2022
HomeNetworkingUtilizing the Linux apropos command – even when it's a must to...

Utilizing the Linux apropos command – even when it’s a must to repair it first


On Linux, the apropos command helps establish instructions associated to some explicit time period. It may be useful to find instructions you would possibly need to use—particularly when you possibly can’t bear in mind their names.

For instance, for those who couldn’t bear in mind the command to show a calendar or put your shell to sleep for a brief time frame, you possibly can attempt these instructions:

$ apropos calendar
cal (1)              - show a calendar
$ apropos sleep
sleep (1)            - delay for a specified period of time
usleep (1)           - sleep some variety of microseconds

For some arguments, like “file”, you’ll get a protracted multi-page itemizing as a result of so many Linux instructions work with information. My system identifies 368 such instructions.

$ apropos file | wc -l
368

In the event you use Linux typically, it’s possible you’ll not should be reminded about many command names. Then again, apropos can typically assist customers uncover instructions that they may not have tried earlier than. Run the command apropos edit, for instance, and also you may be stunned to see much more than vi and nano within the instructions listed.

You may also kind solely a portion of a command identify to get an inventory of instructions containing that substring.

$ apropos xz
unxz (1)             - Compress or decompress .xz and .lzma information
xz (1)               - Compress or decompress .xz and .lzma information
xzcat (1)            - Compress or decompress .xz and .lzma information
xzcmp (1)            - evaluate compressed information
xzdec (1)            - Small .xz and .lzma decompressors
xzdiff (1)           - evaluate compressed information
xzegrep (1)          - search compressed information for an everyday expression
xzfgrep (1)          - search compressed information for an everyday expression
xzgrep (1)           - search compressed information for an everyday expression
xzless (1)           - view xz or lzma compressed (textual content) information
xzmore (1)           - view xz or lzma compressed (textual content) information

Nothing applicable

In the event you attempt the apropos command for clearly legitimate instructions and preserve getting the response “nothing applicable”, you may need to make an vital replace to get it working once more. For probably the most half, you need to solely see a response like this for instructions that don’t exist or that you simply misspell. In the event you get this response repeatedly, you would possibly want to handle the issue.

$ apropos cal
cal: nothing applicable.

Since I hadn’t used apropos in fairly some time, getting solely “nothing applicable” responses left me questioning why apropos had stopped working and when. It took a little bit of head scratching and searching round earlier than I found the mandb command that allowed me to get apropos working once more. The mandb command will create or replace the guide web page index caches, and this turned out to be what my system required. I ran the command as root after which watched because the output stuffed my display screen and stored going.

# mandb
Processing guide pages below /usr/man...
Updating index cache for path `/usr/man/man1’. Wait...mandb: warning: /usr/man/m
an1/grub2-emu.1.gz: whatis parse for grub2-emu(1) failed
mandb: warning: /usr/man/man1/grub2-mount.1.gz: whatis parse for grub2-mount(1)
failed
Updating index cache for path `/usr/man/mann’. Wait...performed.
Checking for stray cats below /usr/man...
Checking for stray cats below /var/cache/man/fsstnd...
Processing guide pages
…

One of many intriguing issues that I seen within the mandb output was the numerous references to “stray cats”. These can be information created by the catman command that use a unique construction than is used for man pages, making displaying them quicker than displaying the unique man pages. The mandb command checks for them whether or not or not they exist in your system.

Wrap-Up

The apropos command is useful once you’re looking for instructions you possibly can’t bear in mind or seeking to uncover some that you simply may not have used earlier than. Luckily, the “nothing applicable” downside is straightforward to resolve and there actually aren’t loads of stray cats hiding in your Linux system.

Be a part of the Community World communities on Fb and LinkedIn to touch upon subjects which are prime of thoughts.

Copyright © 2022 IDG Communications, Inc.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments