Home FAQ How To Easily Recall Forgotten Linux Commands
Recall Forgotten Linux Commands

How To Easily Recall Forgotten Linux Commands

By sk
180 Views

There are hundreds of Linux commands, and remembering all of them is absolutely impossible. Also, it is not necessary though. At times, my mind goes completely blank and I couldn't remember a particular command. I keep looking at the Terminal and try to remember the command, but can't. If you are anything like me, I've got a good news for you. Thanks to Apropos command and BASH history that helps me to easily recall forgotten Linux commands. Apropos is a Linux command that searches the manual page names and descriptions by using a given keyword or string. It comes pre-installed in most Linux distributions and usage is very easy.

Easily Recall Forgotten Linux Commands Using Apropos

Let say you forgot the command to list the contents of a directory. Let us see if apropos can help us in this regard.

$ apropos "list directory"

Sample output:

apropos

apropos command

See? The apropos command displays the list of suggested commands that matches for the given search string. As you see in the example, we can use "dir" command to list a directory contents.

I know it is easy to remember "dir" command, but I have used it here to demonstrate the purpose of Apropos command. You can use any search string. But, some times you need to be more specific when using search strings. For example, the following command will display all commands that contains the word "list".

$ apropos "list"

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 Linux Kernel details, but you forgot the actual command? Here is how you can find it out.

$ apropos "kernel"

Or, run it without quotes:

$ apropos kernel

apropos

In this case, we can use "uname" command to know the details of Linux Kernel.

Please note that you must use quotes when the search string has more than one word.

I forgot the command to access my remote system? What to do? No worries! Use the following command to find out what it is!!

$ apropos "remote"

Be mindful that the Apropos command will display all possible commands that has 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.

$ man apropos

OK, I forgot some lengthy commands that I used few days ago, how to remember them?

No problem. I know a few ways to remember the forgotten Linux commands.

Do a quick reverse search by pressing "CTRL+R" and type the first few letters of the command you're looking for. You will see the list of suggested commands from the bash history. Use UP/DOWN arrow keys to navigate through commands. Once you find out the actual command, press TAB or right arrow key to choose that command and press ENTER key to execute.

Alternatively, you can save or bookmark or apply tags to the important and frequently used commands, so you can use them later without having to search on websites or man pages. Refer the following links for more details.

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

3 comments

Dan November 20, 2019 - 1:33 am

I use ‘TLDR pages’ which is a simplified man pages with examples. Apropos is also good.

Reply
Enrique November 21, 2019 - 12:59 am

I have a different approach. Many times just knowing a command is not enough. We need more context. Cheatsheets can help, but are not enough, so I decided to take a different approach:

https://singlepagebookproject.github.io/IT_notes/

https://singlepagebookproject.github.io/IT_notes/DevOps/linux_administration_summary.html

Pull-request from brave software and admin warriors are welcome!

Reply
sk November 21, 2019 - 12:29 pm

Appreciate your work. I will look into it. Thanks.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More