Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux, confused about 'find' command

Posted on 2014-01-13
2
Medium Priority
?
393 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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.
Suggested Courses

721 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