Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: The Apropos command – Helps to recall forgotten commands  (Read 1472 times)

0 Members and 1 Guest are viewing this topic.

vyshakhv

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
The Apropos command – Helps to recall forgotten commands
« on: December 16, 2017, 03:25:35 pm »
If you forgot the command to list the contents of a directory. Let check it with the apropos command

Code: [Select]
apropos "list directory"
dir (1)              - list directory contents
ls (1)               - list directory contents
vdir (1)             - list directory contents

The apropos command is displaying the list of suggested commands that match for the search string. As you see in the example, we can use “dir” command to list directory contents.

We all know it is easy to remember the command “dir”, but I used it to demonstrate the purpose of Apropos command. You can use any search string. But, sometimes you need to be more specific when using search strings. For example, the following command will display all commands that contain the word “list”.

Code: [Select]
# apropos list
acl (5)              - Access Control Lists
add-shell (8)        - add shells to the list of valid login shells
add_members (8)      - Add members to a Mailman mailing list from the command...
appres (1)           - list X application resource database
chacl (1)            - change the access control list of a file or directory
check_db (8)         - Check the integrity of a Mailman mailing list's databa...
ciphers (1ssl)       - SSL cipher display and cipher list tool.
clone_member (8)     - Clone a Mailman mailing list subscriber address
column (1)           - columnate lists
config_list (8)      - Configure a Mailman mailing list from a text file desc...
corelist (1)         - a commandline frontend to Module::CoreList
dir (1)              - list directory contents
envelopes (5)        - sender/recipient lists attached to messages
fc-list (1)          - list available fonts
File::Listing (3pm)  - parse directory listing
find_member (8)      - Find all Mailman mailing lists that a member's address...
getfacl (1)          - get file access control lists
hosts.equiv (5)      - list of hosts and users that are granted "trusted"r co...
last (1)             - show listing of last logged in users
lastb (1)            - show listing of last logged in users
list_admins (8)      - List all the owners of a Mailman mailing list.
list_lists (8)       - List all Mailman mailing lists on this host
list_members (8)     - List all the members of a Mailman mailing list
listres (1)          - list resources in widgets
locale-gen (8)       - compile a list of locale definition files
lorder (1)           - list dependencies for object files
ls (1)               - list directory contents
lsblk (8)            - list block devices
lsinitramfs (8)      - list content of an initramfs image
lsof (8)             - list open files
lspgpot (1)          - extracts the ownertrust values from PGP keyrings and l...

In such cases, apropos will not help you to find what you’re looking for.

Let me show you another example. Want to find the Kernel but you forgot the actual command? Here is how you can find it.

Code: [Select]
# apropos kernel
random (4)           - kernel random number source devices
readprofile (1)      - read kernel profiling information
rmmod (8)            - simple program to remove a module from the Linux Kernel
setkeycodes (8)      - load kernel scancode-to-keycode mapping table entries
setlogcons (8)       - Send kernel messages to console N
slabinfo (5)         - Kernel slab allocator statistics
slabtop (1)          - display kernel slab cache information in real time
sysctl (8)           - configure kernel parameters at runtime
urandom (4)          - kernel random number source devices

In this case, we can use “sysctl” command to configure kernel parameters at runtime.

Please note that you must use quotes when the search string if you have more than one word. The apropos command will display all possible commands that have the search string in their description. So, you might have to scroll through the results and pick the command that suits you.

For more details, refer man pages.
Code: [Select]
man apropos