Search This Blog

Tuesday, August 19, 2014

How to write one file content into other file, vim, vi, ubuntu, linux, command in terminal

Here to write one file content into other I will explain with two files 'file1' and 'file2'. Here I will add file2 content into file1.

'file1' contents are as below ( I used 'more' command to show the content)


'file2' contents are as below ( I used 'more' command to show the content)

 Now I created a folder 'Test' and kept 'file1' and file2' in 'Test' folder.

Now open 'file1' using vi command. The content of the 'file1' is shown below (vi file1)

To write 'file2' contents into 'file1' follow the below procedure
 
After this you will get the following 'file2' content into 'file1' to the location where your cursor was

to save this do the following
Now you can see that file2 content is saved in file1.

No comments:

Post a Comment