LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-02-2008, 01:23 AM   #1
justmovedtolinux
Member
 
Registered: Sep 2008
Posts: 41

Rep: Reputation: 15
Question Grep V/s Find


What is the difference between the find and grep command. As per my understanding, both of them search the directory mentioned for a file name - Right ?

Linux Archive

Last edited by justmovedtolinux; 10-03-2008 at 02:13 PM.
 
Old 10-02-2008, 01:39 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Find iterates over its arguments, performs tests, and executes commands.

Grep searches for patterns in a list of files or directories.
 
Old 10-02-2008, 01:48 AM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Perhaps to simplify it a little, find would typically find files/directories by name or other attributes, whereas grep finds patterns within a file or files (so a text string inside a configuration file for example)
 
Old 10-02-2008, 03:29 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Your system will run an updatedb service late at night. This updates a database so you can use "locate" to quickly locate a file. A gui alternative to grep is kerry beagle which will operates a bit like google for your own files & possibly websites you have visited.

Last edited by jschiwal; 10-02-2008 at 04:05 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using find /grep gamor Linux - Newbie 14 04-13-2005 02:36 PM
find with grep and replace it dominant Linux - Newbie 4 03-03-2004 01:11 PM
Using grep to find only first instance roballen Linux - General 2 01-29-2004 03:21 AM
help me find grep-2.5.1 shanenin Linux - Software 1 01-23-2004 09:01 PM
trying to use find and grep, but don't know well enough. duhduhdude Linux - Newbie 9 03-22-2003 08:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration