Discussion Locked
0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Can I append the contents of a file say a.txt to the end of another file say b.txt which have opened in Vi
5 replies
by les
yes.
vi b.txt
go to the end of the file (shift + g)
type O for a new line, then press escape to get back to command mode,
type in :r a.txt
(This says read the contents of the file and insert them at the current cursor position.)
note the file must be in the current directory or you should give the full pathname - :r /home/a.txt)
by aag92000
The question was auto-closed by TechRepublic
by #aix!
Easy way out:
Exit vi with :q!
cat a.txt >> b.txt
Now more or vi b.txt
by aag92000
The question was auto-closed by TechRepublic
by aag92000
This question was auto closed due to inactivity
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending
0 helpful
7 replies
0 helpful
6 replies
Question Locked
RE: How to fix the Docker and UFW security flaw
0 helpful
3 replies
Discussion Locked
Which Linux works best on old phone or tablet?
0 helpful
5 replies
Discussion Locked
My Job and Company
0 helpful
3 replies