Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-03-2005, 07:28 PM   #1
LQ Newbie
Registered: Jul 2002
Posts: 27

Rep: Reputation: 15
basic question about searching files


I want to find all files containing "foo" within the body of the file. The files can be either located in the current directory or in a sub-directory.

What is the command for that please??

Thanks in advance,

Old 09-03-2005, 07:38 PM   #2
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

What you're looking for is 'grep'.

'grep -R foo .' will search the current directory and all its subdirectories.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
searching for files deept Programming 1 08-15-2005 11:54 AM
help searching files jorasmi Slackware 3 02-02-2005 04:06 AM
Searching files for strings tmoorman Linux - Software 4 01-08-2004 01:46 PM
editing config files.. embarassingly basic question adhara Linux - Newbie 3 12-23-2003 07:27 AM
Searching for files in KDE 3.1? bolinux Linux - Newbie 1 10-10-2003 11:40 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:07 PM.

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