How To Easily Remember Linux Commands? - CyberSec Nerds
January 24, 2025
Linux

How To Easily Remember Linux Commands?

We all love sleek wizards and eye-catching GUIs. Amidst these easy user interfaces, everyone just hates to use those bare-bone terminals and bear an extra overhead of mugging-up Linux commands. You may get all riled up to act like a pro after watching some cool hacker movies but it eventually dies after typing some commands

Unfortunately, there’s no getting around the fact that you need to learn the commands, but there are some tools that can help you out when you’re getting started and use even the most obscure commands.

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 good news for you. Thanks to all these invaluable tools that help me to easily recall forgotten Linux commands.

Since this is a tutorial about ‘cant-live-without’ commands, I won’t be focusing on the installation of these tools. I am damn sure you can find it on your own.

When You Know What to Do but Don’t Know How To Do

Tool: apropos

This is the tool that will help you find the needle in that massive haystack.

The most common headache for Linux noobies who have just migrated from Windows or macOS is that you know deep inside what you want to do but don’t get a way around to move.

I’m sitting here staring at my terminal, unsure which command it was I needed to do something. Of course, I could probably run a Google search to find out that command, but who has that level of perseverance!

The apropos command is able to search the Linux manual pages, to help you find the command you’re looking for. It’s extremely easy to use and installed by default. Let’s see how simple it is to use, so you don’t have to worry about memorizing a crowd of commands. The syntax of this command is.

$ apropos “search anything”

Now, let us assume we forgot the command that is used to list the directory contents. Seemingly easy, we could make use of the command like this.

apropos tool
Demonstration of ‘apropos’ command

The output of that command will clue you in on the necessary command. Now that we remember ls was the command to dump directory contents into the terminal.

ls is more of an obvious one. Nerds like you (and me) will always want to tinker around the techy pieces of stuff like firewalls, but what’s the command used for defining rules and blocking threats within a firewall? Well, let’s find out.

remember linux commands

There’s a multitude of options available with this command. You can play around with them on your own.

Fish – An Intuitive Shell

Tool: fish

The Friendly Interactive Shell abbreviated as FISH is a user-friendly, interactive shell designed to work with any other shells like Bash or ZSH. It is designed in such a way that users get powerful features that is easy to discover, remember, and use. Unlike other shells which disable various features by default to save system resource, FISH keeps all of them enabled by default so that you can make most out of it.

If you install fish and execute it, you’ll notice right away that the command line prompt is a little different.

Type a letter or two and you will notice that the shell attempts to guess what you want to do, suggesting what you might be trying to type. If you press a tab key, it will begin displaying a list of commands that start with the letter(s) you’ve typed so far. In the display below, only the “l” in “ls” has been typed. Note how the system responds by displaying a previously entered command.

fish tool
What makes it different from other shells?
  • Autosuggestions — Fish suggests commands (in muted gray) as you type, based on your command history and command completions
  • VGA Color — Fish supports 24-bit true color
  • Full scriptability — Simple and clean syntax
  • Web-Based configuration — Using fish_config command for settings
  • Man Page Completions — Fish generates command completion options automatically by parsing installed man pages
  • Syntax highlighting — Fish uses different colors for parts of commands to help users focus on different things (e.g., commands versus arguments)

You can learn more about fish at fishshell.com.

How to Recon?

Tools: whatis, help and man pages

These three tools are the most-have rudimentary weapons in any CyberSec Nerds arsenal. They are used for the most basic to detailed information gathering of other commands.

whatis command is used to get a one-line manual page description. In Linux, each manual page has some sort of description within it. So this command search for the manual page names and show the manual page description of the specified filename or argument in just one line. Let’s have a look at it.

help displays brief summaries of shell builtin commands. If PATTERN is specified, gives detailed help on all commands matching PATTERN. otherwise, the list of help topics is printed. You can use any of the two formats for getting help.

$ “concerned tool” –help
$ “concerned tool” -h

To get a clear picture of help, execute the following. Here, we are concerned about ‘sudo’ command.

help command
An excerpt from help command output

man is the system’s manual viewer; it can be used to display manual pages, scroll up and down, search for occurrences of a specific text, and other useful functions. It is the most detailed description of any command that you will find inside the Linux system.

Actually the information from the manual pages can be overwhelming sometimes.

man command

This is only a small excerpt from the comprehensive man command output which is actually 620 lines long.

“I am sure, I have done this before”

Tool: history

As George Santayana famously said, “Those who cannot remember the past are condemned to repeat it.” Unfortunately, on Linux, if you can’t remember the past, you can’t repeat it, even if you want to. That’s when the GNU history command comes in handy.

The history command keeps track of all the other commands that have been run from that terminal session, then allows you to replay/reuse those commands instead of retyping them. If you are an experienced terminal user, you know about the power of history, but for us dabblers or new sysadmin folks, history is an immediate productivity gain.

In its easiest form, you can use the history command by just typing its name.

history command

The commands are numbered, with the most oldest used (those with the lowest numbers) at the begining of the list.

To have a peek at the last ten commands used, you can pass a number as a argument to the history command.

remember linux commands

The most interesting part is that, if you want to reuse a command from the history list, type an exclamation point (!), and the number of the command with no spaces in-between.

remember linux commands

Tired of Using Long Commands?

Tool: alias

Linux users often need to use one command over and over again. Typing or copying the same command, again and again, reduces your productivity and distracts you from what you are actually doing.

You can save yourself some time by creating aliases for your most-used commands. Aliases are like custom shortcuts used to represent a command (or set of commands) executed with or without custom options. The syntax for alias is as shown below.

$ alias shortName = “your command here”

Here’s how you actually execute it.

$ alias quick=”ls ~/Desktop/Backup”

Now, there is no need to always type that long command to dump the contents of Backup folder in Desktop. Just simpy enter the quick command that we just created.

Remember: If you open a new terminal session, this custom command will no longer be available. If you wish to save your aliases across sessions you will need a permanent alias by editing the .bashrc file (user’s shell configuration profile).

Cheat Tool – Believe me, it doesn’t mean cheating

Tool: cheat

What you do when you are not sure of the command you are running especially in case of complex commands which use a myriad of options. We use man pages to get some help in such situation. Some of the other options may include commands like ‘help‘, ‘whereis‘ and ‘whatis‘. But all has their own pros and cons.

While going through man pages for options and help, the description in man pages are too lengthy to understand specially in short span of time.

Similarly, ‘help‘ command may not give you desired output.

A ‘whatis‘ command gives strict and one-liner answer which is not of much help other than acknowledging the purpose of the command. Moreover, it never says a single word about the available options.

We have used all these options till date to solve our issue in the dilemma but finally, here comes an interactive cheat-sheet application ‘cheat‘ which is going to lead all the rest.

Cheat is an interactive cheat-sheet application released under GNU General Public License for Linux Command line users which serves the purpose of showing, use cases of a Linux command with all the options and their short yet understandable function.

tar is one of the commands of which I always keep on forgetting the arguments which is used for zipping and unzipping files. A pathetic situation of a Linux sys-admin can be best portrayed from the meme as shown.

remember linux commands
Linux Gag

Lets make our work easier with the cheat tool.

Now after learning these commands, you no longer have to stare at the monitor in front of you and blame yourself for poor-memory. There are thousands of commands available on the Linux platform–there’s no shame in not being able to remember all of them. So jus chill and execute in a smart way. Have a great time ahead, folks!

Kiran Dawadi

Founder of cybersecnerds.com. Cybersecurity professional with 3+ years experience in offensive web security, cloud security and building systems. I am a Linux envagelist and highly interested in source-code auditing. You will find me reading InfoSec blogs most of the time.

Subscribe
Notify of
guest

4 Comments
Inline Feedbacks
View all comments
Prabal Devkota
Prabal Devkota
4 years ago

Well composed and simple writing style.

It’s really helpful for beginners to understand about networking security.

Sangam Man Buddhacharya
Sangam Man Buddhacharya
4 years ago

Really it is so much helpful, Thank you kiran sir.