Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Writing to a file on a remote linux machine

I need to connect to a remote linux machine via ssh, take the system information and write it to a file on the remote linux machine.

I’ve tried something like this:

ssh username@remoteip "cat /etc/os-release; hostname" > result.txt

It really takes information about the remote system, but writes it to a local file. How can I write this information to a remote file?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Pls use this, put the file path as remote PC path:

ssh username@remoteip "(cat /etc/os-release; hostname) > /home/remotePC/path/remote_result.txt"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading