Grep doesn't work with both -v and -A/Busing grep to show entries that match a pattern and are present at...
Source of story about the Vilna Gaon and immigration policy
Is 7000 words too long for a chapter?
Why does the Trade Federation become so alarmed upon learning the ambassadors are Jedi Knights?
Why doesn't philosophy have higher standards for its arguments?
When to ask for constructive criticism?
Do First Order blasters maintain a record of when they were fired?
Why don't commercial aircraft adopt a slightly more seaplane-like design to allow safer ditching in case of emergency?
Is this more than a packing puzzle?
Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?
How to change checkbox react correctly?
Why aren't globular clusters disk shaped
Was all the fuel expended in each stage of a Saturn V launch?
A scene of Jimmy diversity
Capacitor with specific self-resonant frequency?
Can you perfectly wrap a cube with this blocky shape?
Why run a service as a system user?
Credit card stolen every 1-2 years. What am I doing wrong?
FPGA CPU's, how to find the max speed?
If I stood next to a piece of metal heated to a million degrees, but in a perfect vacuum, would I feel hot?
Index Uniqueness Overhead
What are "full piece" and "half piece" in chess?
Sending a photo of my bank account card to the future employer
Why use null function instead of == [] to check for empty list in Haskell?
Extension of trace on von Neumann subalgebra
Grep doesn't work with both -v and -A/B
using grep to show entries that match a pattern and are present at least X timesUse grep with orExclude files that have very long lines of text from grep outputRegex doesn't work with grepGrep log and get text between log delimiterscombining grep ignore and matchesHow do I combine grep with multiple arguments and different output switcheswhat command would I use to see all lines from a file starting with a line that I find with grepGrep and counting matching linesGrep doesn't work when trying to match a word from a file in a second file
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
So I'm trying to use grep with both -v argument and -A argument.
So my file has text like:
This error
-this
-this
-that
[text I want]
This error
-asd
-asfag
-adsfhs
[text I want]
[text I want]
This error
-asdgsda
-asdgg
-gasdg
After a tail, I found out that this log file is filled with the same This error
followed by 3 lines construct, and I can easily find them by using grep -A3 'This error'
, this shows me the error and the 3 lines after it.
But I want to see everything OTHER than that, hence the -v argument, but it doesn't work. When I do grep -v -A3 'This error'
it returns the whole file, like grep didn't even work at all.
What is the problem here?
bash grep
add a comment |
So I'm trying to use grep with both -v argument and -A argument.
So my file has text like:
This error
-this
-this
-that
[text I want]
This error
-asd
-asfag
-adsfhs
[text I want]
[text I want]
This error
-asdgsda
-asdgg
-gasdg
After a tail, I found out that this log file is filled with the same This error
followed by 3 lines construct, and I can easily find them by using grep -A3 'This error'
, this shows me the error and the 3 lines after it.
But I want to see everything OTHER than that, hence the -v argument, but it doesn't work. When I do grep -v -A3 'This error'
it returns the whole file, like grep didn't even work at all.
What is the problem here?
bash grep
add a comment |
So I'm trying to use grep with both -v argument and -A argument.
So my file has text like:
This error
-this
-this
-that
[text I want]
This error
-asd
-asfag
-adsfhs
[text I want]
[text I want]
This error
-asdgsda
-asdgg
-gasdg
After a tail, I found out that this log file is filled with the same This error
followed by 3 lines construct, and I can easily find them by using grep -A3 'This error'
, this shows me the error and the 3 lines after it.
But I want to see everything OTHER than that, hence the -v argument, but it doesn't work. When I do grep -v -A3 'This error'
it returns the whole file, like grep didn't even work at all.
What is the problem here?
bash grep
So I'm trying to use grep with both -v argument and -A argument.
So my file has text like:
This error
-this
-this
-that
[text I want]
This error
-asd
-asfag
-adsfhs
[text I want]
[text I want]
This error
-asdgsda
-asdgg
-gasdg
After a tail, I found out that this log file is filled with the same This error
followed by 3 lines construct, and I can easily find them by using grep -A3 'This error'
, this shows me the error and the 3 lines after it.
But I want to see everything OTHER than that, hence the -v argument, but it doesn't work. When I do grep -v -A3 'This error'
it returns the whole file, like grep didn't even work at all.
What is the problem here?
bash grep
bash grep
asked 18 mins ago
user361323user361323
112 bronze badges
112 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f530368%2fgrep-doesnt-work-with-both-v-and-a-b%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f530368%2fgrep-doesnt-work-with-both-v-and-a-b%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown