redirect command output across ssh to a file
by taylorkh from LinuxQuestions.org on (#580VQ)
I think this is rather simple and perhaps I have simply overlooked something. I can access a remote computer using ssh (my key is installed, no password req'd) I can read from a file on that server. Code:[ken@taylor20 ~]$ ssh 10.42.0.1 grep "VA" /etc/protonvpn/allservers
US-VA#1
US-VA#2
US-VA#3
US-VA#4So far so good. I need to write my results to another file on the remote machine. Here is what I would like to do but it does not workQuote:
I could write the results to a local file and then scp the file to the remote computer. However, I am wondering if I can do this in a single step.
Thanks,
Ken


US-VA#1
US-VA#2
US-VA#3
US-VA#4So far so good. I need to write my results to another file on the remote machine. Here is what I would like to do but it does not workQuote:
[ken@taylor20 ~]$ ssh 10.42.0.1 grep "VA" /etc/protonvpn/allservers > /etc/protonvpn/selectedservers bash: /etc/protonvpn/selectedservers: No such file or directory |
Thanks,
Ken