plink command to get .txt output on local commandline

Posted on

Problem :

On a linux server I have a file called “versions.txt”
I would like that output on my local screen (with bash file, I already created that) and then proceed with my bash file.

Annyone has a sugestion how to do this? I already tried alot of different methods in 1 command.

Last I tried was:

start C:toolsPLINK.EXE -ssh -pw <password> -t <user>@ "ls -l" > /var/www/html/test/SM/SCRIPT/versions.txt"

But that doesnt seem to work.

Solution :

If the remote file /var/www/html/test/SM/SCRIPT/versions.txt exists on the machine, this command will output the file to your local stdout:

C:toolsPLINK.EXE -ssh -pw <password> -t <user>@ "cat /var/www/html/test/SM/SCRIPT/versions.txt"

I also remove start, because it starts another shell.

Leave a Reply

Your email address will not be published. Required fields are marked *