Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to find a file with specific string inside it. Post 302419422 by Reboot on Friday 7th of May 2010 05:59:10 AM
Old 05-07-2010
Quote:
Originally Posted by pinga123
Hi ,
Is there any way i can find a file with specific word inside it.
For example if i want to find a file which has some text written inside it.
How would i form a command to search them?

Code:
# find /directory_name/where/file/resides -type f -exec grep "pattern" {} +


Last edited by Reboot; 05-07-2010 at 07:02 AM.. Reason: typo..
This User Gave Thanks to Reboot For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find a string inside files

Hi, I would like to know how to get a list of files that contain a specific string inside them. Thanks (12 Replies)
Discussion started by: yoavbe
12 Replies

2. Shell Programming and Scripting

String substitution on find results inside exec/xargs

What I'm trying to do is perform a copy, well a ditto actually, on the results of a find command, but some inline string substitution needs to happen. So if I run this code find ./ -name "*.tif" I get back these results. .//1234567.tif .//abcdefg.tif Now the action from exec or xargs I... (2 Replies)
Discussion started by: myndcraft
2 Replies

3. UNIX for Dummies Questions & Answers

cmd sequence to find & cut out a specific string

A developer of mine has this requirement - I couldn't tell her quickly how to do it with UNIX commands or a quick script so she's writing a quick program to do it - but that got my curiousity up and thought I'd ask here for advice. In a text file, there are some records (about half of them)... (4 Replies)
Discussion started by: LisaS
4 Replies

4. UNIX for Dummies Questions & Answers

Find something inside a file

Hi, this is the problem i'm facing i need a check some file having some word like gzip or tar ,the way i normally do is grep gzip filenamethe thing is that i had some 1000 files to be checked is that the only way or can i customize it by some script ,i know there is some way ,but i need some... (4 Replies)
Discussion started by: malickhat
4 Replies

5. Shell Programming and Scripting

Find and replace a string a specific value in specific location in AIX

Hi, I have following samp.txt file in unix. samp.txt 01Roy2D3M000000 02Rad2D3M222222 . . . . 10Mik0A2M343443 Desired Output 01Roy2A3M000000 02Rad2A3M222222 . . (5 Replies)
Discussion started by: techmoris
5 Replies

6. Shell Programming and Scripting

read a string from its end to its start and stop when you find a specific character

How can I do this? Actually I have a file which contains a path e.g. /home/john/Music/hello.mp3 and I want to take only the filename (hello.mp3) So, I need to read the file from its end to its start till the character "/" Is this possible? Thanks, I am sure you'll not disappoint me here! Oh,... (9 Replies)
Discussion started by: hakermania
9 Replies

7. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

8. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

9. UNIX for Beginners Questions & Answers

Find all .sh files in file system and need to replace the string inside .sh files

Hi All, I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this. find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies
CWHOIS(3)							   whois client 							 CWHOIS(3)

NAME
CWHOIS - whois client SYNOPSIS
cwhois [-a|-F|-L|-m|-M|-r|-S|-R] [-h hostname] [-s source[[,source]...]] [-T type[[,type]...]] [-i attr[[,attr]...]] keys cwhois [-t type] cwhois [-v type] DESCRIPTION
cwhois Simple whois client that gives you back output, compatiable with RIPE DB v2, if you'll ask it to. OPTIONS
-a search all databases -F fast raw output -L find all Less specific matches -m find first level more specific matches -M find all More specific matches -r turn off recursive lookups -S tell server to leave out 'syntactic sugar' -R force to show local copy of the domain object even if it contains referral -h hostname search alternate server -s source[[,source]...] search databases with source 'source' -T type[[,type]...] only look for objects of type 'type' -i attr[[,attr]...] do an inverse lookup for specified attributes -t type requests template for object of type 'type' -v type requests verbose template for object of type 'type' HINT
Please note that most of these flags are NOT understood by non RIPE whois servers! SEE ALSO
Website <http://www.ripe.net/tools/> AUTHOR
CWHOIS was written by Timur Bakeyev <timur@ripe.net>. This manual page was written by Jan Wagner <waja@cyconet.org>, for the Debian project (but may be used by others). 1.10 2006-11-03 CWHOIS(3)
All times are GMT -4. The time now is 04:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy