How to append or write to a remote file in Linux

This week i was configuration a HP Vertica cluster environment and i needed to alter the /etc/hosts file on all of the hosts/nodes so that they can know each other.

Normally i do it one by one or i use MobaxTerm where i can work on more Linux hosts in the same time running the same commands(example bellow)


MobaxTerm Multiple Window Work

  MobaxTerm is my favorite remote terminal but still i want to make this appending process more automatic.

So let’s see how can we append a line/some lines to a remote file in Linux:

Base syntax :


-we will append a line to a file, and then we read from the file.

So this is easy to implement in a script when you plan to build/add new host to HP Vertica Cluster(in my case).

I hope this was helpful.


I hope this was helpful and i appreciate if you would like, subscribe or share our posts. I it is just a click


Similar Article  Fix for lazy ssh connection
Leave a Comment

%d bloggers like this: