How can I use bash command line to add new line character at the end of file named file.txt. I tried use echo but it\'s not right. Can you show me how
file.txt
echo
Use Vi which automatically creates EOL at EOF on file save.
For example:
vi -escwq foo.txt
or:
ex -scwq foo.txt
To correct multiple files, check: How to fix 'No newline at end of file' for lots of files? at SO