I need to create a text file (unless it already exists) and write a new line to the file all using bash.
I\'m sure it\'s simple, but could anyone explain this to me?
Your question is a a bit vague. This is a shell command that does what I think you want to do:
echo >> name_of_file