Difference Between --help and man Commands

This article introduces the differences between –help and man commands, including their advantages, implementation details, and related resources. These insights can help improve efficiency when using command help documentation.

May 3, 2022 · 1 min read · 200 Words · -Views -Comments · Programming
Linux 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

When looking up command tool parameters, we often use --help, such as rsync --help. Alternatively, we can use the man command, like man rsync. So what’s the difference between them, and how should we choose?

Differences

  1. The man command provides comprehensive usage manuals for all commands available in the system, supported on both Linux and Mac

    • Non-system commands are generally not available, such as man java
    • “man” is short for manual, meaning help documentation
  2. --help is a parameter provided by each command itself, used to print command usage instructions, but some commands may not provide it, such as ssh

    SSH has a special case where the command’s own parameter descriptions are quite brief (like the t parameter without detailed explanation), while man provides much clearer descriptions

https://static.1991421.cn/2022/2022-05-03-005726.jpeg

https://static.1991421.cn/2022/2022-05-03-010520.jpeg

Usage Recommendations

  • For system commands, prioritize using man to view documentation

  • For non-system commands, use the command’s own --help documentation

Final Thoughts

Understanding the distinction between --help and man commands is essential for efficient command-line usage. While --help provides quick, command-specific information, man offers comprehensive system-wide documentation. The choice depends on whether you’re working with system commands (prefer man) or third-party tools (prefer --help). Both tools serve complementary purposes in the Linux/Mac command-line ecosystem.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover