Whenever we use new software or a new operating system, the interface and the environment we are used to change as well. Sometimes the new environment is user-friendly and we don’t find it difficult to deal with. But sometimes the new environment is so complex and foreign to us that we are completely clueless. In this situation, we need someone to guide us or some kind of help from the new environment to lead us to our goals. For this purpose, almost every software and operating system has some kind of built-in help to assist naive and inexperienced users. The Ubuntu terminal or command-line interface also provides us with numerous ways to get help.
How to get Help while Working on the Shell
The ways to get help from Ubuntu terminal or Command-line are listed below:
Use the command options –h or –help
If you don’t know how to use a command i.e. you don’t know about its parameters and return type etc, then you can make use of –h or –help command.
How to use –h or –help?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the taskbar. Simply type your command whose usage you to know in the terminal with –h or –help after a space and press enter. And you’ll get the complete usage of that command as shown below.
Use tab completion on the Shell
If you do not know the exact name of a command, then you can make use of tab completion.
How to use tab completion?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the task bar. Just type the command name that you know in the terminal and then press tab twice as shown below.
Unknown Commands
If you want to use a command, but you do not know whether it’s installed on Ubuntu or not or if it does exist, you do not know the package containing it, even then you can use that command.
How to use an unknown command?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the taskbar. Just type the command in the terminal anyway and press enter. Your terminal will tell you whether it’s installed or not or if it is installed then in which package it exists. This is shown below.
The help command
This is the command which is used for listing all possible commands that are pre-installed in Ubuntu.
How to use help comm
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the task bar. Simply type help in the terminal and press enter key. This is shown below.
The man command or man pages
Man is used when you want to get a detailed manual of a command.
How to use man command?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the task bar. Just write man in the terminal and after a space, write the name of the command whose manual you want and press enter. This command works as shown below.
Example: Run the command
man bash
to get extensive help on the Linux bash shell.
The info command
Some commands do not have their manuals or written or they are either incomplete. To get help with those commands, we use info.
How to use info?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the task bar. Just type info in the terminal and with a space, type the name of the command whose manual does not exist and press enter. This is shown below.
Example:
info bash
The apropos command
This command is used along with another command to search for all the man pages in which the latter command exists.
How to use apropos?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the task bar. Just type apropos in the terminal and after a space, type the name of the command whose appropriate man pages you want to find and press enter. This is shown below.
The whatis command
This command is used with another command just to show a one-liner usage of the latter command from its manual. It’s a quick way of knowing the usage of a command without going through the whole manual.
How to use whatis?
Launch the terminal by pressing Ctrl+ Alt+ T or just click on the terminal icon in the taskbar. Just type whatis in the terminal and after a space, type the name of the command whose one liner description you want, and then press enter.
$ whatis
It is shown below.
By using any of the ways that are listed above, you can get appropriate help from the Ubuntu terminal or Command-line whenever you find yourself in trouble while using it.