|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Search commands in linux.
Hi All,
I am raka. I have probelm in searching a word/string in files. I have more than 500 files in which There are two type of string. 1- logo.cite.net 2-cite.net when do i search for only cite.net using grep command that searched both(logo.cite.net and cite.net).But i want only cite.net. Is there any command to search the required(cite.net) string in linux. Can any one help me fo r above probelm? |
|
#2
|
||||
|
||||
|
grep for ' cite.net' or whatever appears in front of cite.net ...
__________________
--Ax without exception, there is no rule ... The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones ![]() 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. -- Jamie Zawinski |
|
#3
|
|||
|
|||
|
Quote:
can you make it a bit elaborative.. i am new to this. please help me |
|
#4
|
|||
|
|||
|
As Axweildr said use grep, but you will need to use it twice(piped).
First find all matches for 'cite.net' (this will obviously include 'logo.cite.net'), then exclude all matches for 'logo.cite.net'. Code:
grep cite.net * | grep -v logo.cite.net
__________________
"Badges? We ain't got no badges. We don't need to badges! I don't have to show you any stinkin' badges!!" |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Search commands in linux. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|