<p>This is probably <a href="http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/x13320.html" rel="noreferrer">a complex solution</a>.</p>

<p>I am looking for a simple operator like ">>", but for prepending.</p>

<p>I am afraid it does not exist. I'll have to do something like </p>

<pre>
 mv myfile tmp
 cat myheader tmp > myfile
</pre>

<p>Anything smarter?</p>

This still uses a temp file, but at least it is on one line:
```
```
echo "text" | cat - yourfile > /tmp/out && mv /tmp/out yourfile
```
```
Credit:
BASH: Prepend A Text / Lines To a File