Solved

Linux, confused about 'find' command

Posted on 2014-01-13
2
382 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
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now