• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

vi: adding files

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i concatenate 3 already present vi files to new file using vi in unix?
Considering that I have one already made file open.
 
lowercase baba
Posts: 12933
65
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the command

:r <filename>

will insert <filenname> into the currently open file, and the cursor position.  So, open the first file, go to the bottom, and insert the second.  Then if you are not at the bottom (i'm not sure where the first insert would leave you), go to it, and insert the third file.
 
Saloon Keeper
Posts: 22780
153
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

fred rosenberger wrote:I believe the command

:r <filename>

will insert <filenname> into the currently open file, and the cursor position.  So, open the first file, go to the bottom, and insert the second.  Then if you are not at the bottom (i'm not sure where the first insert would leave you), go to it, and insert the third file.



"r" inserts at the current position. Use ":$" to move to the bottom of the buffer before typing each ":r" command.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic