Solved

Linux, confused about 'find' command

Posted on 2014-01-13
2
390 Views
Last Modified: 2014-01-13
I want to find all occurences of thestring '7' withing all the files of my current directory

How can I do this using the command 'find'

How do I do this by finding all occurences of '7' in the current directory and its subdiirectories ?

Thanks
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39776834
Do you mean within the content of the files or within the file names?

Names:

find . -type f -name "*7*"

Content:

find . -type f |xargs grep  "7"

Use

find . -type f |xargs grep  -l "7"

to see just the names of the files witch matching content, not the content itself.
0
 
LVL 2

Expert Comment

by:ITTallahassee
ID: 39776835
find -name '*7*'

Open in new window


That will search the current directory and its subdirectories.

http://linux.die.net/man/1/find
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 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