10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi
I am trying to grep multiple exact word from log file and directing it to a new file.
however my log file has many numeric values, such as 0400, 0401, 0404
and all html error also starts with 404, 401 etc
so I just want to grep only when 404, 401 etc is coming, NOT 0400, OR 0401
i have... (8 Replies)
Discussion started by: scazed
8 Replies
2. 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
3. Solaris
Hi,
I want to find for a particular word which is existing in different files and folders under the parent directory. What command can I use to retrieve all the file names which is having the word. (1 Reply)
Discussion started by: rogerben
1 Replies
4. Shell Programming and Scripting
Hi
Pretty sure this is very simple hence im banging my head o the wall as to why i cant get this to work:
Im greping against many files where there will be the following string:
Date: Thu, Aug 23 2001 09:27 PM
(of course values such as date ,time and PM/AM will vary.)
Im trying to grep... (1 Reply)
Discussion started by: duonut
1 Replies
5. UNIX for Advanced & Expert Users
need a Command in UNIX which can find out a word from files in multiple directories
e.g.
/home contains multiple directories
/home/d1
/home/d2
.
.
.
.
/home/dn
under d1,d2...dn contains multiple files. I need to search a specific word in a files under these multiple... (1 Reply)
Discussion started by: jagkoth
1 Replies
6. Shell Programming and Scripting
Hi,
I have grep command to search for a word "SUB" as below,
grep -w "SUB" file1
But this is taking a word like SUB.XXY or SUB.BBB etc which is not required.. I need only if it is a word "SUB". Any suggestions ???
Thanks,
Vasanth. (11 Replies)
Discussion started by: skcvasanth
11 Replies
7. Shell Programming and Scripting
i want to search in the current directory all the files that contain one word for example "hello"
i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies
8. Shell Programming and Scripting
Guys,
i used egrep "pattern1|pattern2". But the whole word is searched. But i want the output if only the exact word is matched. i.e the output is got evenif a part of the pattern is matched.
I tried the -w opion but its showing usage error.
Please help me out on this one. please sent me... (2 Replies)
Discussion started by: meheretoknow
2 Replies
9. Shell Programming and Scripting
I have a file (file1) with around 5000 records and another file (file2) with 50000 records.
I want to search each word in file 1 from file 2 and spew the output of the matches in file3.
Can someone please help me here.
I tried doing this in ksh
for i in `cat file1`
do
grep -w $i... (15 Replies)
Discussion started by: knijjar
15 Replies
10. Shell Programming and Scripting
is it possible to execute multiple search with grep???
grep criteria1 criteria2 file
something like this...
I know other way:
grep pattern1 file-name1 > results-file
grep pattern2 file-name1 >> results-file
cat results-file
but can it be done with one grep???? (5 Replies)
Discussion started by: amon
5 Replies