If you have a massive text file you want to add a line to without opening the file, here's a quick solution:
sed -e '1i\text_to_insert' -i file.txt