grep to a file from one server to another [duplicate]












-1
















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










share|improve this question















marked as duplicate by RoVo, Rui F Ribeiro linux
Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

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 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
















-1
















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










share|improve this question















marked as duplicate by RoVo, Rui F Ribeiro linux
Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

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 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














-1












-1








-1









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










share|improve this question

















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 linux
Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

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 linux
Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

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 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



















  • 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

















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










1 Answer
1






active

oldest

votes


















0














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





share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    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





    share|improve this answer




























      0














      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





      share|improve this answer


























        0












        0








        0







        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





        share|improve this answer













        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






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 1 at 14:48









        SzczadSzczad

        1615




        1615















            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?