If I want to add one file's contents into another, I use cat command.
and it adds contents of file1 into file2
but the problem is file2 is in diferent system.
Other system's IP is 192.168.1.10
Now I want to add file1 content into file2 in single command line.
I do not want to do following process.
1. copy the file on remote server.
2. log into remote server using ssh
3. add content using cat command.
I want to do it using single command line. I have tried following commands and could not get success.
$ cat /root/file1 >> 192.168.1.10:/root/file2
$ echo `cat /root/file1` >> 192.168.1.10:/root/file2
$ scp `cat /root/file1` >> 192.168.1.10:/root/file2
Even I have tries to do it something like this which I did not want but it couldn't work for me too.
$ scp /root/file1 192.168.1.10:/root/file3 | ssh 192.168.1.10 cat /root/file3 >> 192.168.1.10:/root/file2
Please help me. I will be thankful.