Difference Between --help and man Commands

· 1 min read

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.