Append
Jump to navigation
Jump to search
Append at the end of a file:
echo "your_line_to_append" >> your_file.txt
tee --append ~/.ssh/config << END Host localhost ForwardAgent yes END
Using sed
sed -i s/^/TEST_TO_APPEND_AT_BEGINNIG/ file.txt
- Append a space at the beginning of lines:
- Append a text (TEST_TO_APPEND_AT_END) at the end of a line (
$
):
sed -i s/$/TEST_TO_APPEND_AT_END/ file.txt
Related[edit]
lineinfile
- Shell redirection:
>
and>>
- Prepend
- list
- Add line
See also[edit]
Advertising: