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 can I do it?
相关问题
- What is the best way to do a search in a large fil
- JQ: Select when attribute value exists in a bash a
- Spring Integration - Inbound file endpoint. How to
- bash print whole line after splitting line with if
- “command not found” errors in expect script execut
相关文章
- Check if directory exists on remote machine with s
- What is the correct way to declare and use a FILE
- Making new files automatically executable?
- Reverse four length of letters with sed in unix
- Launch interactive SSH bash session from PHP
- BASH: Basic if then and variable assignment
- Bash script that creates a directory structure
- Test if File/Dir exists over SSH/Sudo in Python/Ba
Adds a newline character at the end
This works on centos the empty string above didn't.
Use Vi which automatically creates EOL at EOF on file save.
For example:
or:
To correct multiple files, check: How to fix 'No newline at end of file' for lots of files? at SO
With
sed
:with
echo
: