Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unix: prepending a file without a dummy-file?

I do not want:

$ cat file > dummy; $ cat header dummy > file

I want similar to the command below but to the beginning, not to the end:

$ cat header >> file
like image 888
hhh Avatar asked Mar 23 '10 20:03

hhh


1 Answers

You can't append to the beginning of a file without rewriting the file. The first way you gave is the correct way to do this.

like image 157
Mark Byers Avatar answered Oct 21 '22 10:10

Mark Byers