I want to do some grep-magic to a logfile on a remote server and write the result to a local file on my computer.

Is there an easier way than my 3 step solution:

  1. do grep-magic and write file on remote server
  2. copy from remote to local with scp
  3. delete the file on remote

Just execute the command in the remote server through ssh and store the output locally:

ssh myuser@thatserver 'grep "aa"' > ~/myoutput.res
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.