- Terminal Basics #10: Getting Help in Linux Terminal
- Get help with Linux commands in the terminal
- Wait! What are shell built-in commands?
- Use man to see command documentation
- Use help command for shell built-ins
- Help option for all commands
- There are more ways to get help in Linux terminal
- This is the end. or the beginning
- 8 Ways To Get Help On The Linux Shell
- How to get Help while Working on the Shell
- Use the command options –h or –help
- Use tab completion on the Shell
- Unknown Commands
- The help command
- The man command or man pages
- The info command
- The apropos command
- The whatis command
- Search
- About This Site
- Latest Tutorials
Terminal Basics #10: Getting Help in Linux Terminal
Learn how you can get help about using Linux commands in the final chapter of the Terminal Basics series.
These days, you can search the internet for the usage and examples of any command. But it was not like this when the internet didn’t exist, or it was not as widely available to everyone. For this reason, commands in Linux (and the operating systems before it) come with a help or manual page (man pages). This worked as a reference and users could access it anytime to see what options were available for a command and how it worked. The man pages are still relevant in this age of information abundance. First, they are the original command documentation and hence the most trusted source on command usage. Second, if you are taking some Linux exam, you will not be allowed to search on the internet but the man pages are always at your disposal. Now that you understand the importance of getting help directly in the terminal, let’s see more about them.
Get help with Linux commands in the terminal
Wait! What are shell built-in commands?
You may feel that commands like ls, rm, mv are part of the bash shell. But that’s not true. Shell only has a few commands that are built into it as a part of the shell itself. This is why they are called built-in commands. Some examples of built-in commands are echo, cd, and alias.
Other popular Linux commands like ls, mv, rm, cat, less, etc are part of a software package called GNU coreutils. They come preinstalled on almost all Linux distributions.
You won’t find man pages for the shell built-ins.
[email protected]:~$ man cd No manual entry for cd
The man pages are for these ‘external’ Linux commands. The shell built-ins have help sections.
Use man to see command documentation
Using the man command is simple. Just give it command’s name like this:
And it will open the manual page of the command. You’ll find the syntax of the command, its options, and a brief explanation of the options.
The pages are (usually) opened with the less command so you can use all the keyboard shortcuts of the less command to move around and search for text.
Don’t remember it? This will help you recall
Keys | Action |
---|---|
Up arrow | Move one line up |
Down arrow | Move one line down |
Space or PgDn | Move one page down |
b or PgUp | Move one page up |
g | Move to the beginning of the file |
G | Move to the end of the file |
ng | Move to the nth line |
/pattern | Search for pattern and use n to move to next match |
q | Exit |
There is more to man pages than. I cannot cover it all here, but we do have a detailed guide. Feel free to refer to it.
Use help command for shell built-ins
As mentioned earlier, no man pages exist for the built-in shell commands. Instead, you use the help command like this:
It will show a summary of the command options. The entire content is displayed on the screen, unlike the man command.
Help option for all commands
Do you feel the man page has too much information and you just want to see the options of a command? The help option ‘helps’ you.
Almost all Linux commands provide a —help option that should summarize the available options.
However, it’s not a hard and fast rule. The help sections of some commands are pretty bland. Try it for the ip command.
There are more ways to get help in Linux terminal
There is the info command that works similar to the man command.
If you find man pages complicated to understand, there are third-party tools that simplify the content of man pages and make it more beginner friendly. TLDR is one such package you can use.
In other words, the help is just a few key presses away.
It’s not that only new Linux users need help. Experienced Linux users specially rely on the manpages. So don’t shy away from using the help in the terminal.
I also advise using the history command. This way, you can search for the commands you typed earlier.
This is the end. or the beginning
And with this, I conclude the Linux Terminal Basics series.
In the ten chapters of the series, you got familiar with the terminal, learned to move around in the terminal, and create, move and delete files and folders. You also learned to read and edit files.
This gives you a basic but solid foundation of Linux commands. It may be the end of this series, but it helps begin your Linux command line journey.
You’ll find more in-depth guides on ‘doing things in Linux command line’ on It’s FOSS in the future. It may not be in a series (or maybe it will) but you’ll have plenty of opportunity for learning.
💬 I hope you liked this beginner series. I welcome your feedback on the usability of this series and suggestions to improve it. If you have any suggestions for a related new series, please don’t hesitate. The comment section is waiting for you.
8 Ways To Get Help On The Linux Shell
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.
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.
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.
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.
Search
About This Site
Vitux.com aims to become a Linux compendium with lots of unique and up to date tutorials.