Operating System - Linux
1753707 Members
5202 Online
108799 Solutions
New Discussion юеВ

append line to the end of file

 
Pat Peter
Occasional Advisor

append line to the end of file

I need to append a line to the end of a file.

Can anyone please help me.

-Pat
6 REPLIES 6
Peter Godron
Honored Contributor

Re: append line to the end of file

Pat,
echo "text to add" >> file_to_add_to
Ninad_1
Honored Contributor

Re: append line to the end of file

Pat,

Do a
echo "text" >> filename

This will append the text at the end of file filename

Regards,
Ninad
Coolmar
Esteemed Contributor

Re: append line to the end of file

Pat,

Use >> to append to a file.

echo "line you want to add" >>file
Arturo Galbiati
Esteemed Contributor

Re: append line to the end of file

Hi Pat,
if lines are in a file use:
cat filea >>fileb

if you want to add lines in interactive mode:
cat<>fileb
,.,.,.
klk
EOD

HTH,
Art
Peter Godron
Honored Contributor

Re: append line to the end of file

Pat,
plenty of answers there.
Could you please identify solution and close.
Oviwan
Honored Contributor

Re: append line to the end of file

Hi

take a look on the manpage of "tee".

Regards