10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
2. Shell Programming and Scripting
Hi,
Can someone please help me with a Command to Search a FILE for a STRING in multiple DIRECTORIES.
I am searching for the VIP in HTTPD.CONF in multiple httpd instances.
I am using
find ./ -name "httpd.conf" | xargs grep 10.22.0.141 cut -d: -f3- | cut -d ' ' -f4 | sort | uniq -c
... (1 Reply)
Discussion started by: crosairs
1 Replies
3. Shell Programming and Scripting
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
4. Shell Programming and Scripting
Hi,
I need someone's help in writing correct perl code.
I implemented following code for "multiple search strings replaced with single string".
=========================================================
#!/usr/bin/perl
my $searchStr = 'register_inst\.write_t\(' |... (2 Replies)
Discussion started by: chettyravi
2 Replies
5. Shell Programming and Scripting
Hello.
I have five config files in /etc that I want to edit in one click for testing.
I would like to make a script like this :
#!/bin/bash
#
a_file="/etc/file_1"
src_str="src_string_1"
rpl_str="rpl_string_1"
calling_sed_or_awk_or_whatelse $a_file search_for_all $src_str replace_with... (4 Replies)
Discussion started by: jcdole
4 Replies
6. Shell Programming and Scripting
I tried awk for this, but failed <or my code is not correct? I dont know>. Can anyone help me on this?
---------- Post updated at 08:34 PM ---------- Previous update was at 08:29 PM ----------
my working file looks like this:
<empty>
<empty>
<empty>
NAME :ABC AGE :15
GENDER... (6 Replies)
Discussion started by: kingpeejay
6 Replies
7. Shell Programming and Scripting
Hi,
filenames:
contains name of list of files to search in.
placelist
contains the names of places to be searched in all files in "filenames"
for i in $(<filenames)
do
egrep -f placelist $i
if ]
then
echo $i
fi
done >> outputfile
Output i am getting: (0 Replies)
Discussion started by: pinnacle
0 Replies
8. Shell Programming and Scripting
Hi,
I have to look for the full string below in a large file(>5GB) , but that string may be spread in two lines.
string :-- "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1"
By grep "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1" file | tail -1
, I am getting incorrect result because there is a line after this also which... (1 Reply)
Discussion started by: finder255
1 Replies
9. UNIX for Dummies Questions & Answers
I have a couple of things I got stuck on
1)
I have a text file containing 25k search string that I need to search against compressed file. I have used this command but somehow it doesn't seems to use all the search terms.
I have put one search string per line in the txt file (I clean up... (2 Replies)
Discussion started by: m00
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I am newbie in UNIX so please excuse for my questions.
Is there a a way to search for string in files within folder and sub folder in particluar file extensions.
Ex. search for ABC in folder 'A'(including it's sub folders) in html, xml files.
Thanks,
Ani (2 Replies)
Discussion started by: anikanch
2 Replies