[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Linux, find a string

Posted on 2012-09-06
1
Medium Priority
?
564 Views
Last Modified: 2012-09-06
How can I find what files contain a given string inside a directory

As you can do in the windows command

find "abc" *.*

Open in new window

0
Comment
Question by:Los Angeles1
1 Comment
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 38372419
Recursively (with subdirectories):

cd /path/to/directory
grep -R "string" .

(note the dot at the end!)

or

grep -R "string" /path/to/directory

or (non-recursively):

cd /path/to/directory
grep "string" *

or

grep "string" /path/to/directory/*
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question