grep to a file from one server to another [duplicate]
This question already has an answer here:
Linux equivalent to PowerShell's “one-to-many” remoting
7 answers
I have a grep command like below
zgrep '123_ERROR' xyz.gz
I got lot of huge results where I cannot see top part.
So what is best way to see entire result
how to export results to a file
zgrep '123_ERROR' xyz.gz>>/home/test/testfile.txt
i used above command but i do not seem to have permission to create testfile.txt
how to create above file in one other server whose ip is say 111.1.111.111
linux grep
marked as duplicate by RoVo, Rui F Ribeiro
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Mar 1 at 17:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Linux equivalent to PowerShell's “one-to-many” remoting
7 answers
I have a grep command like below
zgrep '123_ERROR' xyz.gz
I got lot of huge results where I cannot see top part.
So what is best way to see entire result
how to export results to a file
zgrep '123_ERROR' xyz.gz>>/home/test/testfile.txt
i used above command but i do not seem to have permission to create testfile.txt
how to create above file in one other server whose ip is say 111.1.111.111
linux grep
marked as duplicate by RoVo, Rui F Ribeiro
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Mar 1 at 17:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Hi an welcome to StackExchange. Unfortunately, it is very unclear what you're asking. Please edit your question to show exactly what you're trying to do (input and expected output), and where you are stuck. Also, to see the 'complete' output, you can just pipezgrep
intoless
ormore
.
– Panki
Mar 1 at 14:22
I don't know why the IP would affect this. You've tried to write to a file/home/test/testfile.txt
Unless your current user is calledtest
you probably don't have access to do this. You can easily reference your own home directory with~
. Eg:zgrep '123_ERROR' xyz.gz ~/testfile.txt
– Philip Couling
Mar 1 at 14:30
add a comment |
This question already has an answer here:
Linux equivalent to PowerShell's “one-to-many” remoting
7 answers
I have a grep command like below
zgrep '123_ERROR' xyz.gz
I got lot of huge results where I cannot see top part.
So what is best way to see entire result
how to export results to a file
zgrep '123_ERROR' xyz.gz>>/home/test/testfile.txt
i used above command but i do not seem to have permission to create testfile.txt
how to create above file in one other server whose ip is say 111.1.111.111
linux grep
This question already has an answer here:
Linux equivalent to PowerShell's “one-to-many” remoting
7 answers
I have a grep command like below
zgrep '123_ERROR' xyz.gz
I got lot of huge results where I cannot see top part.
So what is best way to see entire result
how to export results to a file
zgrep '123_ERROR' xyz.gz>>/home/test/testfile.txt
i used above command but i do not seem to have permission to create testfile.txt
how to create above file in one other server whose ip is say 111.1.111.111
This question already has an answer here:
Linux equivalent to PowerShell's “one-to-many” remoting
7 answers
linux grep
linux grep
edited Mar 9 at 8:57
Rui F Ribeiro
41.6k1483141
41.6k1483141
asked Mar 1 at 14:18
user7599667user7599667
1
1
marked as duplicate by RoVo, Rui F Ribeiro
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Mar 1 at 17:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by RoVo, Rui F Ribeiro
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Mar 1 at 17:20
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Hi an welcome to StackExchange. Unfortunately, it is very unclear what you're asking. Please edit your question to show exactly what you're trying to do (input and expected output), and where you are stuck. Also, to see the 'complete' output, you can just pipezgrep
intoless
ormore
.
– Panki
Mar 1 at 14:22
I don't know why the IP would affect this. You've tried to write to a file/home/test/testfile.txt
Unless your current user is calledtest
you probably don't have access to do this. You can easily reference your own home directory with~
. Eg:zgrep '123_ERROR' xyz.gz ~/testfile.txt
– Philip Couling
Mar 1 at 14:30
add a comment |
Hi an welcome to StackExchange. Unfortunately, it is very unclear what you're asking. Please edit your question to show exactly what you're trying to do (input and expected output), and where you are stuck. Also, to see the 'complete' output, you can just pipezgrep
intoless
ormore
.
– Panki
Mar 1 at 14:22
I don't know why the IP would affect this. You've tried to write to a file/home/test/testfile.txt
Unless your current user is calledtest
you probably don't have access to do this. You can easily reference your own home directory with~
. Eg:zgrep '123_ERROR' xyz.gz ~/testfile.txt
– Philip Couling
Mar 1 at 14:30
Hi an welcome to StackExchange. Unfortunately, it is very unclear what you're asking. Please edit your question to show exactly what you're trying to do (input and expected output), and where you are stuck. Also, to see the 'complete' output, you can just pipe
zgrep
into less
or more
.– Panki
Mar 1 at 14:22
Hi an welcome to StackExchange. Unfortunately, it is very unclear what you're asking. Please edit your question to show exactly what you're trying to do (input and expected output), and where you are stuck. Also, to see the 'complete' output, you can just pipe
zgrep
into less
or more
.– Panki
Mar 1 at 14:22
I don't know why the IP would affect this. You've tried to write to a file
/home/test/testfile.txt
Unless your current user is called test
you probably don't have access to do this. You can easily reference your own home directory with ~
. Eg: zgrep '123_ERROR' xyz.gz ~/testfile.txt
– Philip Couling
Mar 1 at 14:30
I don't know why the IP would affect this. You've tried to write to a file
/home/test/testfile.txt
Unless your current user is called test
you probably don't have access to do this. You can easily reference your own home directory with ~
. Eg: zgrep '123_ERROR' xyz.gz ~/testfile.txt
– Philip Couling
Mar 1 at 14:30
add a comment |
1 Answer
1
active
oldest
votes
If you wish to do that remotely you can do it this way:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
or
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
The first command greps results and sends back to you while less
is invoced by your host.
The second command does everything on the remote server (the pipe is sent to the other end).
To be precise if you wish to store the output on your computer you could run:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz >> local_file
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you wish to do that remotely you can do it this way:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
or
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
The first command greps results and sends back to you while less
is invoced by your host.
The second command does everything on the remote server (the pipe is sent to the other end).
To be precise if you wish to store the output on your computer you could run:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz >> local_file
add a comment |
If you wish to do that remotely you can do it this way:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
or
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
The first command greps results and sends back to you while less
is invoced by your host.
The second command does everything on the remote server (the pipe is sent to the other end).
To be precise if you wish to store the output on your computer you could run:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz >> local_file
add a comment |
If you wish to do that remotely you can do it this way:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
or
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
The first command greps results and sends back to you while less
is invoced by your host.
The second command does everything on the remote server (the pipe is sent to the other end).
To be precise if you wish to store the output on your computer you could run:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz >> local_file
If you wish to do that remotely you can do it this way:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
or
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz | less
The first command greps results and sends back to you while less
is invoced by your host.
The second command does everything on the remote server (the pipe is sent to the other end).
To be precise if you wish to store the output on your computer you could run:
ssh 111.1.111.111 zgrep '123_ERROR' xyz.gz >> local_file
answered Mar 1 at 14:48
SzczadSzczad
1615
1615
add a comment |
add a comment |
Hi an welcome to StackExchange. Unfortunately, it is very unclear what you're asking. Please edit your question to show exactly what you're trying to do (input and expected output), and where you are stuck. Also, to see the 'complete' output, you can just pipe
zgrep
intoless
ormore
.– Panki
Mar 1 at 14:22
I don't know why the IP would affect this. You've tried to write to a file
/home/test/testfile.txt
Unless your current user is calledtest
you probably don't have access to do this. You can easily reference your own home directory with~
. Eg:zgrep '123_ERROR' xyz.gz ~/testfile.txt
– Philip Couling
Mar 1 at 14:30