11-24-2016
Grep for all ip addresses mentioned in all files in a Directory
I wish to traverse all files and folders under a given directory say "/tmp/configuration" and
for all ip address mentioned therein.
I tried
find ./ -type f | xargs grep "*.*.*.*" but it does not populated the correct results.
Can you please suggest.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am not sure if i am doing this correctly since it returns quickly. i need to grep for a keyword in all files in a directory
grep keyword /mydirectory
is that correct? I just want to know which files have a keyword in it.
i am using korn shell in solaris 5.1. There does not appear to... (12 Replies)
Discussion started by: guessingo
12 Replies
2. Shell Programming and Scripting
Hi guys,
Can you please help me print all the executable files of a directory(in this case /home) using grep?
All i know is that this command should do it but it doesnt...
ls -l ~ | grep -..x
it shows me the following mesage
grep: invalid option -- '.'
Χρήση: grep ... ΥΠΟΔΕΙΓΜΑ ... (3 Replies)
Discussion started by: jimas13
3 Replies
3. Shell Programming and Scripting
Hi
I have an input file with a list of random IP addresses, each on a new line. Below is just an example as I omitted the real IP addresses for obvious reasons.
Input: random_ip.txt
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1
10.0.0.1... (7 Replies)
Discussion started by: lewk
7 Replies
4. Shell Programming and Scripting
Hi,
I have used the command
cat * | grep -r <<String>> *
It returns:
cat : JAN : is directory
***********************
*********************
My directory structure:
log
- JAN
-catalina.out
-FEB
-catalina.out
-MARCH
... (11 Replies)
Discussion started by: nanthagopal
11 Replies
5. Shell Programming and Scripting
Hi All,
I have a directory containing a lot of files and I want to search all files which contains IP addresses pattern and want to replace those ip addresses with equal number of, say, some character, 'x'. So after replacement the file should not contain any IP address. Like
10.122.53.5 ->... (3 Replies)
Discussion started by: sanzee007
3 Replies
6. Shell Programming and Scripting
Hi All,
Can any one help me here.I'm getting whole files name of the directory along with the grep result.
below is the code
var=`grep -i '127.3.3.1' _record`
echo $var (9 Replies)
Discussion started by: netdbaind
9 Replies
7. Shell Programming and Scripting
Hi,
I've been trying to filter a file which has several repetitions of lines which looks as follows:
('hello
My name is
jamie
blabla
xyz>>)
Each line has different values in them. I want grep or awk or sed to treat everything within the (' and >>) as one line and then filter for a... (2 Replies)
Discussion started by: jamie_123
2 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Let's say if we have a file with a lot of information.
For example:
iiadam
otterhedgehog
kayleigh... (2 Replies)
Discussion started by: ForeignGuy
2 Replies
9. UNIX for Beginners Questions & Answers
Command 1:
$script | grep 'Write to ECC( SSID=MARGIN)'
Command 2:
$script | grep 'is not greater than existing logical processing'
The above commands run my script and search the mentioned strings but I do not want to run my script twice. It is increasing run time.
Can someone tell me... (3 Replies)
Discussion started by: Tanu
3 Replies
10. UNIX for Beginners Questions & Answers
Hi there from a newbie.
So, I have this huuuge portion of mail addresses with names interlaced.. looks like:
"name1" <mail1@domain1.com>, "name2" <mail2@domain2.com> ...
Sometimes there are no names, just mailaddress. My thought was to use regex with grep. I saved the list in file ma and... (2 Replies)
Discussion started by: dr_xemacs
2 Replies