How to Get Help for a Terminal Command on Linux Mint

Share
In this tutorial, we'll learn about three different methods you can use to learn more about what a specific terminal command does on Linux, what options it provides and what arguments it supports.

Man Pages

The first and safest method is to use the man command. This is a manual program, also known as "man pages." For example, if you type:

man apt

You get interactive help for the apt command.

Interactive means that the terminal command doesn't just print its output and terminates, displaying the shell prompt promptly after. Instead, it keeps running until you press something. For man, you can press the arrow keys to scroll the text, and you press the q key to quit the manual.

--help

By convention, when a program receives an argument --help, it won't execute as normal, but instead just print a help text and terminate.

Note that, because this is merely a convention, it isn't guaranteed to happen—it's just the typical way it's done. This means that it's generally safer to use man instead of --help since the behavior of man is known, while the behavior of a random program isn't known.

For example, if we type echo --help, we won't get help text because the program echo always just prints all arguments passed to it, and doesn't treat --help in a special way. On the other hand, apt --help works.

Internet

To be honest, for most commands on Linux neither the manual pages nor --help is going to help much. You'll often be met with an immense wall of text with many options for rare scenarios you'll never personally encounter. Worst of all, the manual pages seem to NEVER have any practical usage examples! I can't count how many times all I wanted was a basic usage example for the most basic use case only to be met with dozens of pages about the minutia of the arguments you can pass the command, and when you need that minutia, the minutia you need is going to be missing.

For example, the manual page for ls doesn't even tell you what the columns of ls -l mean. What is the manual for, then?

Instead of the manual, you'll typically rely on the Internet (i.e. Google) to get help with terminal commands, perhaps from an online forum post, or from a Linux tutorial.

In fact, there have been efforts to create man pages' alternatives with examples instead of walls of text.

  1. [tldr.sh], a collaborative online resource for terminal commands.
  2. [bropages.org], same idea, now deprecated.

Although it's not a good idea to trust the output of LLM's like ChatGPT, they're still very good at pointing you toward the general direction you want to go, so if you want a command to do something, you can ask them what would that command be, and then use Google to search for a tutorial about it.

Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments