Sponsored Content
Top Forums Shell Programming and Scripting Looking for command(s)/ script to find a text string within a file Post 302097196 by wrwelden on Wednesday 22nd of November 2006 08:16:38 AM
Old 11-22-2006
Looking for command(s)/ script to find a text string within a file

I need to search through all files with different file suffixes in a directory structure to locate any files containing a specific string
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find a string in a file and add some text after that file

Hi Could you please help me out by solving teh below problem ? I have a file with as below source1|target1|yes source2|target2|no source1 is file in which i have to place some code under the <head> tag in it. What code i have to place in source1 is something like this "abcd.....<target1>... (5 Replies)
Discussion started by: Tasha_T
5 Replies

2. Shell Programming and Scripting

How to redirect a input of find command into a text file

Hello friends, I want a command to print the reult files from find command into a text file.:) Iam looking from forum memebers. PLZ help me.ASAP Thanks in Advance, Siva Ranganath CH (5 Replies)
Discussion started by: sivaranga001
5 Replies

3. Shell Programming and Scripting

Find string in text file

Hello! Please, help me to write such script. I have some text file with name filename.txt I must check if this file contains string "test-string-first", I must cut from this file string which follows string "keyword-string:" and till first white-space and save it to some variable. For... (3 Replies)
Discussion started by: optik77
3 Replies

4. Shell Programming and Scripting

find string(s) in text file and nearby data, export to list help

Hi, So I'm kinda new to shell scripts and the like. I've picked up quite a bit of use from browsing the forums here but ran into a new one that I can't seem to find an answer for. I'm looking to parse/find a string AND the next 15 or so charachters that follow the string within a text file... (1 Reply)
Discussion started by: kar23me
1 Replies

5. Shell Programming and Scripting

Find multiple string in one file using find command

Hi, I want find multiple string in one file using find coomand. And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies

6. Shell Programming and Scripting

How to find repeated string in a text file

I have a text file where I need to find the string = ST*850* This string is repetaed several times in the file, so I need to know how many times it appears in the file, this is the text files: ISA*00* *00* *08*925485USNR *ZZ*IMSALADDERSP... (13 Replies)
Discussion started by: cucosss
13 Replies

7. UNIX for Dummies Questions & Answers

How to pass file text into find command

Hi all, I have a large text file and also a smaller list of program names. I want to find out how many of those programs exist in the large text file. Can someone help me with the command/script please. The program list is along the lines of tranwe2 tranwe3 tranye5 etc so basically I... (5 Replies)
Discussion started by: Grueben
5 Replies

8. Shell Programming and Scripting

[Need help] perl script to find the occurance of string from a text file

I have two files 1. input.txt 2. keyword.txt input.txt has contents like .src_ref 0 "call.s" 24 first 0x000000 0x5a80 0x0060 BRA.l 0x60 .src_ref 0 "call.s" 30 first 0x000002 0x1bc5 RETI .src_ref 0 "call.s" 31 first 0x000003 0x6840 ... (2 Replies)
Discussion started by: acdc
2 Replies

9. UNIX for Beginners Questions & Answers

Find and replace a string in a text file

Dear all, I want to find all the "," in my text file and then replace the commas to a tab. I found a script online but I don't know how to modify the script for my case. Any one can help? Thank you. @echo off &setlocal set "search=%1" set "replace=%2" set "textfile=Input.txt" set... (2 Replies)
Discussion started by: forevertl
2 Replies

10. Shell Programming and Scripting

How can I use find command to search string/pattern in a file recursively?

Hi, How can I use find command to search string/pattern in a file recursively? What I tried: find . -type f -exec cat {} | grep "make" \; Output: grep: find: ;: No such file or directory missing argument to `-exec' And this: find . -type f -exec cat {} \; -exec grep "make" {} \;... (12 Replies)
Discussion started by: cola
12 Replies
LOCATE(1)						    BSD General Commands Manual 						 LOCATE(1)

NAME
locate -- find files SYNOPSIS
locate [-d dbpath] pattern DESCRIPTION
locate searches a database for all pathnames which match the specified pattern. The database is recomputed periodically, and contains the pathnames of all files which are publicly accessible. Shell globbing and quoting characters (``*'', ``?'', ``'', ``['' and ``]'') may be used in pattern, although they will have to be escaped from the shell. Preceding any character with a backslash (``'') eliminates any special meaning which it may have. The matching differs in that no characters must be matched explicitly, including slashes (``/''). As a special case, a pattern containing no globbing characters (``foo'') is matched as though it were ``*foo*''. Options: -d dbpath Sets the list of databases to search to dbpath which can name one or more database files separated by ``:'', an empty component in the list represents the default database. The environment variable LOCATE_PATH has the same effect. FILES
/var/db/locate.database Default database EXIT STATUS
locate exits with a 0 if a match is found, and >0 if no match is found or if another problem (such as a missing or corrupted database file) is encountered. SEE ALSO
find(1), fnmatch(3), locate.conf(5), weekly.conf(5), locate.updatedb(8) Woods, James A., "Finding Files Fast", ;login, 8:1, pp. 8-10, 1983. HISTORY
The locate command appeared in 4.4BSD. BSD
April 19, 2004 BSD
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy