2

I normally run a command like

cat <<EOF >> /path/to/file some stuff more stuff EOF 

However, this time, I want to overwrite the existing file and not append to it. How can I accomplish this?

2 Answers 2

2

Change >> to >.

>> means append to file.

> means write file from scratch.

1

To overwrite a file instead of appending to it you can use > instead of >>.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.