help Command in Linux with examples

18 Feb, 2021
If you are new to LINUX operating system and having trouble dealing with the command-line utilities provided by LINUX then you really need to know first of all about the help command which as its name says help you to learn about any built-in command.help command as told before just displays information about shell built-in commands. Here’s the syntax for it:
// syntax for help command

$help [-dms] [pattern ...]

The pattern specified in the syntax above refers to the command about which you would like to know and if it is matched with any shell built-in command then help give details about it and if it is not matched then help prints the list of help topics for your convenience. And the d, m and s here are options that you can use with the help command.
Using help command
To make you understand more easily about what help command does let’s try help command for finding out about help itself.
// using help

$help help
help: help [-dms] [pattern...]
    Display information about builtin commands.

    Displays brief summaries of builtin commands. If PATTERN IS
    specified, gives detailed help on all commands matching PATTERN,
    otherwise the list of help topics is printed.

    Options:
      -d        output short description for each topic
      -m        display usage in pseudo-manpage format
      -s        output only a short usage synopsis for each topic matching
        PATTERN

    Arguments:
      PATTERN   Pattern specifying a help topic

    Exit Status:
    Returns success unless PATTERN is not found or an invalid option is given.

/* so that's what help command
does telling everything
about the command and 
helping you out */

Options for help command
-d option : It is used when you just want to get an overview about any shell built-in command i.e it only gives short description.
-m option : It displays usage in pseudo-manpage format.
-s option : It just displays only a short usage synopsis for each topic matching.
Using help with options
Using -d : This option just lets you know about what a command does without giving you details about its options and other stuff.// using help with -d

$help -d help
help - Display information about builtin commands.

// using help with -d

$help -d help
help - Display information about builtin commands.

Using -s : This option is when you just want to know about the syntax of a command.// using help with -s 

$help -s help
help: help [-dms] [pattern ...]

// using help with -s 

$help -s help
help: help [-dms] [pattern ...]

Using -m : This is used to display information about a command in pseudo-manpage format.// using help with -m

$help -m help
NAME
    help - Display information about builtin commands.
SYNOPSIS
    help [-dms] [pattern ...]
DESCRIPTION
    Display information about builtin commands.

    Displays brief summaries of builtin commands. If PATTERN IS
    specified, gives detailed help on all commands matching PATTERN,
    otherwise the list of help topics is printed.

    Options:
      -d        output short description for each topic
      -m        display usage in pseudo-manpage format
      -s        output only a short usage synopsis for each topic matching
        PATTERN

    Arguments:
      PATTERN   Pattern specifying a help topic

    Exit Status:
    Returns success unless PATTERN is not found or an invalid option is given.

SEE ALSO
    bash(1)
IMPLEMENTATION
    GNU bash,version 4.3.11(1)-release (i686-pc-linux-gnu)
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later 


// using help with -m

$help -m help
NAME
    help - Display information about builtin commands.
SYNOPSIS
    help [-dms] [pattern ...]
DESCRIPTION
    Display information about builtin commands.

    Displays brief summaries of builtin commands. If PATTERN IS
    specified, gives detailed help on all commands matching PATTERN,
    otherwise the list of help topics is printed.

    Options:
      -d        output short description for each topic
      -m        display usage in pseudo-manpage format
      -s        output only a short usage synopsis for each topic matching
        PATTERN

    Arguments:
      PATTERN   Pattern specifying a help topic

    Exit Status:
    Returns success unless PATTERN is not found or an invalid option is given.

SEE ALSO
    bash(1)
IMPLEMENTATION
    GNU bash,version 4.3.11(1)-release (i686-pc-linux-gnu)
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later 


So that’s all about help command.Linux Tutorials | Getting Help and Escaping | GeeksforGeeks - YouTubeGeeksforGeeks532K subscribersLinux Tutorials | Getting Help and Escaping | GeeksforGeeksWatch laterShareCopy linkInfoShoppingTap to unmuteIf playback doesn't begin shortly, try restarting your device.More videosMore videosYou're signed outVideos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer.CancelConfirmSwitch cameraShareInclude playlistAn error occurred while retrieving sharing information. Please try again later.Watch on0:000:001:33 / 3:39•Live•<div class="player-unavailable"><h1 class="message">An error occurred.</h1><div class="submessage"><a href="https://www.youtube.com/watch?v=USMVhdydb4Y" target="_blank">Try watching this video on www.youtube.com</a>, or enable JavaScript if it is disabled in your browser.</div></div>
linux-command
Linux-system-commands
Linux-Unix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.