How do you remove the end of a file in Unix?
You can remove the newline character at the end of file using following easy way:
- head -c -1 file. From man head : -c, –bytes=[-]K print the first K bytes of each file; with the leading ‘-‘, print all but the last K bytes of each file.
- truncate -s -1 file.
11 янв. 2016 г.