Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow Internal.
Ask questions, find answers and collaborate at work with Stack Overflow Internal. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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?
Change >> to >.
>>
>
>> means append to file.
> means write file from scratch.
To overwrite a file instead of appending to it you can use > instead of >>.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.