I use both
--help in Bash programming to get help.
For example, to get information about usage of
ls command, I may use
Both give some what similar output. What is the difference between these two?
If a program installs a manual page, it can always be accessed via the
Finally, you mention Bash programming in your question—none of this is unique to Bash. Bash doesn't care about the commands themselves or their arguments for the most part.
|show 1 more comment|
In most scenarios
In the first you asking the system to search the manual pages for help on the command. The second you are asking the command to provide its own help. The two will most certainly differ - usually the command provides a reminder of its options where as the man page is a detailed description.
GNU, which doesn't like manual pages for some reason, also introduced
Oh What is the dam flag for compress?
I find the help command on flags sometimes very very usefull and less time consuming. With man ive gota type it in and the go back through my history to get back to the command I was in.