Find a string in a path


 
Thread Tools Search this Thread
Operating Systems Linux Find a string in a path
# 1  
Old 02-06-2014
Find a string in a path

Hi All,

I am trying to find a particular string in a path, but able to do so.
I tried through grep command but its taking so long time which is not appropriate.

e.g:
Path : /oct/oracle/apps/OMEC/appl/xxaterp/1.0/reports/US/

Suppose in this path we have 10 .rdf file and I want to search a particular string i.e. XXATARCUST_TABLE (custom table name) where ever used in that path i.e. in any rdf or file. I want name of that file/rdf in which that string is present.

Please any one help on this.

Thanks,
VKS
# 2  
Old 02-06-2014
Try:
Code:
grep -l XXATARCUST_TABLE /oct/oracle/apps/OMEC/appl/xxaterp/1.0/reports/US/*.rdf

# 3  
Old 02-07-2014
Thnx for reply but grep is taking so long time to fetch the data.
Can we achieve this by "awk" command....whose performance
is also good. Please help me on this.

Thanks,
Vks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find string in file and find the all records by string

Hello I would like to get know how to do this: I got a big file (about 1GB) and I need to find a string (for instance by grep ) and then find all records in this file based on a string. Thanks for advice. Martin (12 Replies)
Discussion started by: mape
12 Replies

2. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

3. Shell Programming and Scripting

if PATH contains a certain string problem!

Hi I am using MKS Toolkit c shell. I want to basically check if my PATH variable already contains a certain path directory so I tried this (it didnt work!): if: Expression Syntax if ( echo $path |grep -c c:/PROGRA~1/blah/blah ) then please help me get this little statement to work. ... (3 Replies)
Discussion started by: vas28r13
3 Replies

4. Shell Programming and Scripting

Determining whether given string is path or not

I have an issue while determing whether given string is unix path or not There is a text file which is normally a report in that at some place we have unix path as shown below /opt/smart/dev/eur/sources/sqr and not unix path as shown below Threshold Year/Month/Ref/ActLine/OUC Is there... (3 Replies)
Discussion started by: lalitpct
3 Replies

5. Shell Programming and Scripting

Find and replace string from file which contains variable and path - SH

e.g. /home/$USER/.config replace it with "" (empty) Is this possible? I think you should play a bit with sharps ## and sed:b: (2 Replies)
Discussion started by: hakermania
2 Replies

6. Shell Programming and Scripting

Remove path string from file (string contains "/")

This is the way sed -i 's/home/$USER/.config/hello_there//g' /home/$USER/.gnomerc But, as far as I saw you cannot add any "/" in the string you want to remove.... So, what should I do in order to remove this path (which contains "/") ?:confused: (7 Replies)
Discussion started by: hakermania
7 Replies

7. Shell Programming and Scripting

Resolved: Building a string with a path in it

I know this is probably simple, but the brain cells that originally stored my shell scripting classes from 10+ years ago have long since been drowned in beer. I need to create a string (to append to a file) containing a path derived from the current path. Basically, I want to append "/something"... (3 Replies)
Discussion started by: Spetnik
3 Replies

8. Shell Programming and Scripting

How to find the path

Hi Iam new to this forum, could you pleae advise for below question iam send path as input before proceding i need to validate the path if it is exit or not if not it show path id not exist if the path is exits iam sending file name as input to search the file on the paricular... (5 Replies)
Discussion started by: saic
5 Replies

9. Shell Programming and Scripting

How To Replace A String In File With A String Containing Windows File Path

Hi, I have a file with the following contents # Lines that start with a # are comments. # # Calling TOAD like this will perform a comparison from command line : # # "C:\Program Files\Quest Software\Toad for Oracle 9.6\toad.exe" -c... (2 Replies)
Discussion started by: rajan_san
2 Replies

10. Solaris

Please help me find the PATH that I need to be on :)

I am learning UNIX through the School of Hard Knocks, I have very limited exposure to it. I managed to install Solaris 10 on my machine recently, and have downloaded and installed Sun Studio 11. When the installation of Sun Studio was complete, the GUI displayed the following: (Bourne shells)... (7 Replies)
Discussion started by: trmn8r
7 Replies
Login or Register to Ask a Question