Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857
Rep:
Well, frankly, if you aren't willing to read the man pages first, then you probably shouldn't waste other folks time with your questions.
Your question: "What is grep used for?"
From the man page for grep:
"Grep searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a match to the given PATTERN. By default, grep prints the matching lines."
Your question: "Is it used like whereis?"
From the man page for whereis:
"whereis locates source/binary and manuals sections for
specified files. The supplied names are first stripped of
leading pathname components and any (single) trailing
extension of the form .ext, for example, .c. Prefixes of
s. resulting from use of source code control are also
dealt with. whereis then attempts to locate the desired
program in a list of standard Linux places." (so the clear inference would be "NO, its not used like whereis")
I am gonna go out on a limb and say that everyone that regularly participates in this forum does so out of a genuine interest in helping others. I don't think its too much to ask that someone read the documentation that comes with a product.
well, just an opinion but i think it is a timewaster for me personally, as i have always learned far better when a person explains things to me in layman's terms. sorry for being so dyslexic...
Assuming you are coming from Windows (probably most of us did) - it's like the Find command on the Start menu. The commands Find and Whereis are like if you put text in the "Named" box - they find filenames. Grep is like if you put text in the "Containing text" box - it finds files that contain the text specified. Very useful if you are looking for that great recipe that used kiwi, but can't remember where the file is or what it was called...
/js
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.