Append

From wikieduonline
Revision as of 09:47, 19 April 2023 by Welcome (talk | contribs) (→‎Related)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Append at the end of a file:

echo "your_line_to_append" >> your_file.txt

history -a

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:
sed s/^/" "/
sed -i s/$/TEST_TO_APPEND_AT_END/ file.txt

Related[edit]

See also[edit]

Advertising: