You can append text at the end of a file using sed with the a command. Here’s the syntax:
sed -i '$ a Your text here' filename.txt
-ioption edits the file in place.$specifies the last line of the file.ais the command to append text.
For example, to append "Hello, World!" to the end of example.txt, you would use:
sed -i '$ a Hello, World!' example.txt
