How to concatanate two files
Hi i have just started learning Linux.
Please help me by answering below question file1 ABCDEF GHIJKLM NOPQRST UVWXYZ file2 12345 6789 i want to have file3 as ABCDEF GHIJKLM 12345 6789 NOPQRST UVWXYZ Regards Vijay |
Do you want to insert the content of file 2 after the second line of file 1? Here are three solutions using sed, awk and pure bash respectively:
Code:
sed '2rfile2' file1 Code:
awk '!(NR % 3){while ( getline line < "file2" ) print line}1' file1 Code:
while read line |
All times are GMT -5. The time now is 02:17 PM. |