Using text commands to merge file content
Let's start with something simple – which is merging file content. Of course, we are only discussing text content here as merging binary files would be pointless. Our goal is to learn how to use two commands – paste
and cat
– to do simple things, such as concatenation and merging line by line. Let's start!
Getting ready
We just need one Ubuntu and one CentOS machine for this recipe. Here, we are going to use cli1
and cli2
to master these commands.
How to do it…
Starting with the simplest command for this chapter – cat
– let's see some examples of what it does. If we type in a command such as cat filename.txt
– if a file named filename.txt
exists – we are going to get the content of that file on display. Let's check an example of this:
So, we used the cat
command to show the...