Thursday, February 27, 2014

Execute a command in remote PC

I want to patch a file in remote m/c and was trying to use ssh command, didn't know it was so easy ;)

Basics:
To execute a command in remote m/c
ssh user@ip

To execute multiple commands in remote m/c
ssh user@ip  'command | command'

To execute a local script in remote pc
ssh user@ip  'command' <  local_script

My command:
ssh user@ip 'patch -p0 --dry-run -d ' < patch_file.patch


More info from this link

No comments:

Post a Comment