Searching of IP_add in multiple scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Searching of IP_add in multiple scripts
# 1  
Old 09-28-2010
Searching of IP_add in multiple scripts

Hi forum memebers,

I want know what is the grep command a IP_add or host in the multiple scripts in one directory.


Thanks in advance.
Siva Ranganath.Smilie
# 2  
Old 09-28-2010
I am not sure if I understood - you are looking for names of files that contain the strings "IP_add" and/or "host"? Be more clear and precise please, thanks.

Last edited by zaxxon; 09-28-2010 at 11:27 AM.. Reason: Rephrasing
# 3  
Old 10-02-2010
I am not sure what you mean.What i understand is that you have many files in one folder and you are looking which files contains a string(In you case an IP address).
If you are looking for this you can use grep command with the syntax
#grep -i <IP_Address> *.*

*You should be in the directory contains the files
# 4  
Old 10-02-2010
Quote:
Originally Posted by @dagio
I am not sure what you mean.What i understand is that you have many files in one folder and you are looking which files contains a string(In you case an IP address).
If you are looking for this you can use grep command with the syntax
#grep -i <IP_Address> *.*

*You should be in the directory contains the files
*.* is a DOS-ism which doesn't make sense in a UNIX shell and UNIX filesystem where file extensions aren't hardcoded into everything. * is sufficient to match all files.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. BSD

Searching in multiple files

I am new to unix and I would like to search multiple log files to find earliest occurrence of a text. Ex: Say I have 10 logs file each ending with .log and I want to find the text “CustomeError” . I want to find the which log file “CustomeError” comes first and lines which surround’s ... (4 Replies)
Discussion started by: jim john
4 Replies

2. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

3. Shell Programming and Scripting

Nawk help searching for multiple lines and multiple searches

I use this command to find a search (Nr of active alarms are) and print one line before and 10 lines after the search keywords. nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=1 a=10 s="Nr of active alarms are:" *.log However, I would like to know how to tell it to print... (3 Replies)
Discussion started by: tthach830
3 Replies

4. Shell Programming and Scripting

searching different multiple directories

Suppose I have 5 different directories in some path .Is it possible to search 5 different directories using find command in one single command line. I mean something like this:- find path -type d -name dirname1 dirname2 .......... pls help (2 Replies)
Discussion started by: maitree
2 Replies

5. Shell Programming and Scripting

Writing a script for multiple occurence of IP_Add in 3 diffrent directories .

Hello members. How can i write a script to find a multiple occurence of IP_ADD in the 3 different directories and under one path.after finding the IP_add redirect into a text file. for example home dir: /fdp/cdg under home directory there are several files and directories.so I have to... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

6. Shell Programming and Scripting

Searching of IP_add in multiple scripts! ASAP

Hello Friends, Plz help me for below query? I want search the IP_ADD from multiple files which are txt file or .sh files or .xml files which are present in different directories .Iam looking for Forum memebers help. Advance thanks to forum memebers.Plz reply me ASAP?:) (4 Replies)
Discussion started by: sivaranga001
4 Replies

7. UNIX for Dummies Questions & Answers

Searching multiple items

Hi, I'm a complete newbie so bear with me. I have a directory (and sub-dirs) full of .doc, .xls files. What I'm trying to do is do a single search within the files (i.e. within each .doc etc) for occurrences of multiple items e.g. apples, pears, grapes, bananas. Basically I'd provide a... (4 Replies)
Discussion started by: kainfs
4 Replies

8. Shell Programming and Scripting

Email searching with in scripts

Hi guys.. Would anyone know the best way to search 700 odd scripts so that it returns certain required results? I need the search to return the script name, subject and any email address found. The mail part of the script will look something like below and there can be more than one... (1 Reply)
Discussion started by: Jazmania
1 Replies

9. Shell Programming and Scripting

Searching multiple files with multiple expressions

I am using a DEC ALPHA running Digital UNIX (formly DEC OSF/1) and ksh. I have a directory with hundreds of files that only share the extension .rpt. I would like to search that directory based on serial number and operation number and only files that meet both requirements to be printed out. I... (6 Replies)
Discussion started by: Anahka
6 Replies
Login or Register to Ask a Question