Linux man vs info vs help confusion - is there a better way?
I'm using Linux Mint XFCE, and I wanted to find some information about the bash shell command 'read' so I opened up a terminal and typed 'man read' - but I got a page about the C programming function read().
Then I tried 'info read' but that gave me a page about the 'readlink' command. Finally I tried 'help read' and that gave me what I wanted. I know from past experience that there are man pages for other shell commands, so what's with 'read'? Is it just that nobody has ever written a man page for the shell command 'read', or is it that somebody got in first with 'read()' so 'read' couldn't be added? Is there a better way of finding information than just jumping from man to info to help in the hope of finding what I want? Sometimes this combination of man/info/help seems chaotically messy, and I can't help wondering if I'm not searching correctly. |
There are multiple sections to the man pages - read this for background https://en.wikipedia.org/wiki/Man_page#Manual_sections.
(you'll see that the same keyword can appear in different sections with different definitions - its all about context) See also http://man7.org/linux/man-pages/dir_all_by_section.html and for searching I use http://linux.die.net/man/. HTH |
Quote:
In the case of 'read', it seems that I should be able to find it in section 1, along with other bash commands, by typing 'man 1 read' but as I get the response 'No manual entry for read in section 1' I assume nobody has ever written a man page for read, or at least included it in the Ubuntu version of the man pages. |
Quote:
Try info bash or man bash, or the bash reference manual. |
As read is a builtin command of bash it does not have an own man pages. But more over its within the man bash page. So is the builtin command help. Which on the opposite of man only 'helps' on builtin commands of bash. Also you state that you found the read command in section 1 of man I doubt that it is really the read builtin command man page due to it beeing builtin...
If that does not make much of a sense lets say it in bash: Quote:
|
Quote:
Quote:
It does make it difficult when the linux command information is scattered across different help systems. I'm starting to think I'd be better off going straight to google instead of trying to find information on my computer - at least it's a unified search system. |
Quote:
|
I tend to use the on-line sources mentioned by Chris, but a useful command is "apropos". Using "apropos read" gives a ton of answers which includes
read [builtins] (1) - bash built-in commands, see bash(1) |
Quote:
Quote:
Code:
apropos read |
genogebot:
for external commands that may have a man page, use which <term> If found then man <term> or other info/apropos... If not found by which <term>, use type <term> eg: Code:
which read Have a Great Day! |
Quote:
|
What I do in order
Code:
unkowncommand -h |
In case you have not thought to look at man man, it is really worthwhile reading for a top down orientation - and not actually very long.
On the other hand, man bash is very long, but very much worth becomming familiar with! Code:
read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] For example, when looking for the above read information, I successively did the following without thinking about it... Code:
man bash The bash man page itself is a trove of dense, useful information once you learn your way around. But not much good for late night recreational reading! Another comment, I always use the man pages first, and do not often need to go further. But, when man does not produce the desired answer, info almost always does. Info tends to have many more details, but usually require more effort on my part to locate what I need. This may be a failing of my methods more so than the info pages themselves. We have come to expect instant access to information we seek, without actual effort on our part. But it seems to me we often spend much more time looking for "quick" answers than it would take to extract and understand the more useful and complete answer, including its place in the greater context. Man pages require the latter approach to be really useful, but reward your efforts proportionally! |
Quote:
|
Ok, I think this is a good discussion. I've learned a lot from this, I have a much better understanding of the man/info/help systems and my own preference is starting to take shape.
This is my personal take on the Linux man/info/help/etc situation so far, based on my attempts to use them in Linux Mint 17.1 XFCE: man Pros: Lots of detailed informationinfo Pros: Similar to man. Produced better 'apropos' results than man for 'apropos read'. ('man --apropos read' did not list the bash builtins answer, but 'info --apropos read' did.)help Pros: Good for searching for information on builtin commands that may be harder to find with man or info, as the answer takes you straight to the relevant page.--help, -h, -?, etc. Pros: Good for a quick reminder of command usage.Internet search Pros: If the search terms are appropriate, a link to the relevant information may be available almost instantly. (My internet search for 'linux read' gave me the information I wanted as the second link on the results page - the first being the read() command in C - in a couple of seconds.) No need for prior knowledge of specific categories within the Linux man/info/help pages. No need to learn man/info search techniques. Most people already know how to do an internet search. No dependence on distro inclusions/exclusions. Links may also provide information about problems and solutions relating to the use of a command, which is entirely absent from the Linux man pages.My conclusion (so far...): I use Linux every day on four different computers (one desktop, two laptops and a server, plus a couple of other computers that get intermittent use) and I think it's great. Having said that, I'm not a hardcore Linuxer, I just use it to get things done and I have no desire to learn Linux just for the sake of learning Linux. For me, then, the best solution is the one that gives me the relevant information as quickly and easily as possible, whether it's something I'm already familiar with or not. The man/info/help systems on Linux seem to be designed more as references for the experienced, rather than as learning tools for the inexperienced, so in that sense I think they rate poorly in terms of user-friendliness. Sometimes I've spent way too much time trying to find local information about commands that I've never used before and I won't use again for months or longer, by which time I'll need to look them up again. Based on the discussion on this thread and my own investigation of people's suggestions (and yes, I've tried them all), I think the best first solution for me is internet searching, unless I already have a good idea of where to find the information in the system, in which case I'm happy to use man or info or help or --help or -h or -?. |
All times are GMT -5. The time now is 08:48 PM. |