LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Learning to look for information locally instead of online ..... (https://www.linuxquestions.org/questions/linux-newbie-8/learning-to-look-for-information-locally-instead-of-online-4175573711/)

fanoflq 03-02-2016 01:42 AM

Learning to look for information locally instead of online .....
 
I looked at man page for grep:

grep [OPTIONS] PATTERN [FILE...]

Then I looks for description of permissible PATTERN.
But there is not such discussion in man grep!

This seems like a recurring problem in man pages.
Where can I get information within Linux?
I am aware I can look online.
But I like to learn how to get such information locally.

Thank you.

astrogeek 03-02-2016 02:24 AM

Quote:

Originally Posted by fanoflq (Post 5508871)
I looked at man page for grep:

grep [OPTIONS] PATTERN [FILE...]

Then I looks for description of permissible PATTERN.
But there is not such discussion in man grep!

This seems like a recurring problem in man pages.
Where can I get information within Linux?
I am aware I can look online.
But I like to learn how to get such information locally.

Thank you.

Sure there is - look down the page for REGULAR EXPRESSONS, character classes, anchoring, repetition, concatenation, alteration, precedence, etc...

It actually has quite a bit of information on pattern matching (i.e. regular expressions), but in reality that is a much larger subject in its own right.

Admittedly it can take a little time to learn your way around the man pages, but they are surprisingly complete for the most part, although they can require a different reading style than most other things.

One quick way to scan through them is to repetitively search for a word of interest, such as "pattern", by typing /pattern <ENTER>, then /<ENTER> for next, ?<ENTER> for previous. That would lead you to regular expressions if you did not know the term.

Also, at the bottom of the man page is a SEE ALSO section which will list related man pages. In the case of grep there is a see-also for awk, sed, pcre, pcresyntax and regex, all of which have valuable information on regular expression pattern matching.

But, extra points to you for trying to find your way around - time well spent!

hydrurga 03-02-2016 03:54 AM

Quote:

Originally Posted by fanoflq (Post 5508871)
But I like to learn how to get such information locally.

That's very admirable, but we have a whole internet out there full of people who are exchanging info, examples, tutorials, problems, solutions. Why hide in a box when all that is at your fingertips?

In particular, you will be able to find a lot about commands on your Linux box, but what you don't find are a lot of are real-world examples of how to use those commands. I personally understand commands better when shown examples of their usage. Out there in the internet, these are in abundance.

grail 03-02-2016 04:39 AM

I agree with both of the above views. Learning to use your systems built-in information is invaluable and can solve many problems immediately. That being said you should not cut something out
to spite your effort, ie. the online information in concert with that gleaned from the man pages will make you very well informed on each command you attempt to perfect :)


All times are GMT -5. The time now is 09:23 AM.