Question: how can i get the following output using perl or awk or is it possible in linux command? 

file1:

```
1
2
2
4

```

file2:

```
5
6
7
8

```

Desired output:

```
1   5
2   6
2   7
4   8

```

Answer: 
with command `paste` 

```
paste  file1  file2

```
A more flexible solution for when the lines in the file aren't fixed width would be with `pr`:

```
$ pr -mtw 10 file1 file2
1    5
2    6
3    7
4    8

```

Changing `file1` to containing variable width lines: 

```
$ cat file1
The number 1
two
3
The last number is the number four

# With pr two columns are output    
$ pr -mt  file1 file2
The number 1                        5
two                                 6
3                                   7
The last number is the number four  8

# Paste simply inserts a tab which doesn't format the output in two columns
$ paste file1 file2
The number 1    5
two     6
3       7
The last number is the number four      8

```