How to search for a Linux command using a keyword in the terminal?

Published December 19, 2022

To search for a Linux command using a keyword or what it does in the terminal, you can use the apropos linux command followed by a keyword. If the keyword belongs to any linux commands it will show a list of commands with a small description on its side.

For example, let's say we need to find the command to change the folders or the directory. To do that first, we can use the apropos command followed by writing the keyword called change folder.

It can be done like this,

# To find the command for changing folder/directory
apropos change folder

After executing the above command in the terminal, we can see a list of commands matching the keyword with its description shown to us. For me, the list looks like this,

# list of commands matching the keyword
setreg(1)                - Change settings for public key cryptography
DevToolsSecurity(8)      - Change the security authorization policies for developer systems
autofsd(8)               - daemon to update autofs mounts on network changes
body(n)                  - change the body for a class method/proc
cd(ntcl)                 - Change working directory
changelog(n), doctools::changelog(n) - Processing text in Emacs ChangeLog format
chflags(1)               - change file flags
chgrp(1)                 - change group
chmod(1)                 - change file modes or Access Control Lists
chown(8)                 - change file owner and group
chpass(1), chfn(1), chsh(1) - add or change user database information
chroot(8)                - change root directory
config_data(1)           - Query or change configuration of Perl modules
configbody(n)            - change the "config" code for a public variable
dde(ntcl)                - Execute a Dynamic Data Exchange command
dsconfigad(8)            - retrieves/changes configuration for Active Directory
encode_keychange(1)      - produce the KeyChange string for SNMPv3
ldappasswd(1)            - change the password of an LDAP entry
ldif(5)                  - LDAP Data Interchange Format
lower(ntcl)              - Change a window's position in the stacking order
lset(ntcl)               - Change an element in a list
newgrp(1)                - change to a new group
odutil(1)                - allows caller to examine or change state of opendirectoryd(8)
pt_json_language(n), pt::json_language(n) - The JSON Grammar Exchange Format
raise(ntcl)              - Change a window's position in the stacking order
seek(ntcl)               - Change the access position for an open channel

Now if we look through the list of commands, we can see that we need the 4th command in the list called cd which also has a small description of Change working directory which is what we want in our case.

We have successfully searched using a keyword and found the linux command to use directly in the terminal itself. Yay 🥳!

That's all 😃.

Share on: Facebook Twitter