Linked Questions
12 questions linked to/from grep with logic operators
0
votes
3
answers
456
views
grep AND feature from anywhere on the line [duplicate]
Is there any way for grep to have an AND feature? I mean something like this:
I have these lines:
I have this one line
I don't have this other line
I have this new line now
I don't have this other ...
0
votes
2
answers
119
views
Alternative to multiple greps [duplicate]
I am reading a list of outputs for pipewire in a shell script and looking for a specific entry. I don't know the exact name but I know the words that are in it. To find it I am using multiple greps ...
-1
votes
1
answer
61
views
using multiple grep in a logical OR fashion [duplicate]
is there a way to do this?
cat somefile.txt | grep this_pattern OR grep that_pattern
I want display only certain lines from a large file however not just by one pattern.
For example
cat output.txt | ...
11
votes
4
answers
51k
views
How can I find all lines containing two specified words, case-insensitively? [duplicate]
I need to check if two (specified) words exist on any line in a text file. There are no limits for the characters of the words. For example:
I want to find lines of a text file that contain the two ...
4
votes
2
answers
37k
views
What is the equivalent "AND" operator to the "|" in RegExes when using "awk"?
I know that | is the logical "OR" operator inside a RegExp expression. But what is the equivalent "AND" operator (again, inside a RegExp)?
Note:
This is not about the multiple ...
5
votes
2
answers
2k
views
"grep string | grep string" with awk without pipe [duplicate]
Is there a way to do:
output | grep "string1" | grep "string2"
BUT with awk, WITHOUT PIPE?
Something like:
output | awk '/string1/ | /string2/ {print $XY}'
Result should be ...
7
votes
4
answers
4k
views
How to find all files containing various strings from a long list of string combinations?
I am still very new to command line tools (using my Mac OSX terminal) and hope I haven't missed the answer somewhere else, but I have searched for hours.
I have a text file (let's call it strings.txt)...
0
votes
2
answers
2k
views
Using Grep to find two words on same line
I'm looking to use grep(or egrep) to find two words that are on the same line. ONT and MONDAY
Flight# Airline Depart Arrive Day
------------------------------------------
93104 TEAM ONT ...
0
votes
2
answers
934
views
finding multiple strings in a line
I'm brand new to Unix and am using CygWIN64 simulator. I have a huge number of text files (tens of thousands) that I need to search for specific strings. I have had success teaching myself to search ...
0
votes
2
answers
825
views
How can I best search for 2 instances of 2 consecutive words on a line with grep or other search utility
I have a log file that has 2 instances of 2 consecutive words on a line.
Example:
Process ID: 1034 Worker Process 4
I want to search for "Process ID" AND "Worker Process" on the same line.
The ...
1
vote
2
answers
322
views
output mixed alphanumeric input with grep,pipe and cat
I have a mixed wordlist as an input:
azert12345
a1z2e3r4t5
a1z2e3r455
The command line I have tried to execute:
cat file.txt | grep -E "[[:digit:]]{5}" --color
What do I want to accomplish:
Print ...
-1
votes
1
answer
75
views
How to search for lines that fulfill more than one criterion in Unix?
I want to find the number of the lines that have both words/patterns "gene" and "+" in them. Is this possible to do this with grep?