file1
1
2
3
4
file2
5
6
7
8
result I want
1
5
2
6
3
7
4
8
which file1 alternative with file2
not like
1
2
3
4
5
6
7
8
can I merge file like this?
file1
1
2
3
4
file2
5
6
7
8
result I want
1
5
2
6
3
7
4
8
which file1 alternative with file2
not like
1
2
3
4
5
6
7
8
can I merge file like this?
As an alternative to the sed
method suggested by @Michael, you can also use the paste
command, in this case: paste -d \\n file1 file2
Have you tried the below in the linux command line?
cat file2.txt >> file1.txt
This will append the text in file1 to file 2.
Edit: Having seen your query is referring to intertwining the files, I think this article will help you using the 'sed' command: https://unix.stackexchange.com/questions/288521/with-the-linux-cat-command-how-do-i-show-only-certain-lines-by-number