Using the Help Command in Linux

After the man page, the help utility is the best way to seek help from the terminal where you can learn how you use a specific command.

So in this quick tutorial, I will walk you through how you can use the help command to get the most out of it.

Use the help command in Linux

To learn any command, it is always a good idea to start with the command syntax so here's a syntax for using the help command:

help [options] [pattern]

Here,

  • [options] is used to modify the default behavior of the help command using various options available to it.
  • pattern is the topic on which you are seeking help. In simple terms, here's where you specify the name of the command.

Looks interesting? Let's explore some examples of using the help command.

1. Get help from the help command itself

So generous. Right? But I couldn't think of a better way to kick off this guide, as this will demonstrate what you should be expecting from the help command:

help help

Once you execute the help command, it will show a short description of the specified command with available options.

2. Get command info in the man page manner

If you've ever used the man pages in Linux, you must be familiar with what it gives you. For those who don't know, the man page gives you a command description, flags description, and more.

To use the help command to get info in man page manner, use the following syntax:

help <command_name>

For example, here, I wanted to seek help on the cd command:

help cd

3. Get a short description of a command

To get a short description of a command with the help command, you can use the -d flag in the following manner:

help -d <command_name>

Let's suppose I want to get a short description of the cd command, so I used the following command:

help -d cd

4. Get the syntax of a command

You can also use the help command to only get the syntax of a specific command. For that, you'd have to use the -s flag in the following manner:

help -s <command_name>

Here's how got the syntax of the cd command using the help command:

help -s cd

Get more details with the man pages

The sad part about the help command is it does not include information about many commands such as ls, apt, find, etc.

In that case, your only option is the man page.

I know, it may be overwhelming for beginners and you may not be able to utilize to its maximum potential and this is why we made a detailed guide explaining how to get the most out of the man pages in Linux:

Understanding the man pages in Linux
Though extremely useful, man pages in Linux can be daunting and intimidating at first. This article aims to make it a bit easier to peruse manuals and quickly get the help one needs.

I hope you will find this guide helpful.