Stop Nano from adding newline character to end-of-file

I use Nano for all of my cli text file editing and I had always noticed that it puts a newline at the bottom of the file, but this has never bothered me much. Well today it caused me quite a headache at work, so I had to figure out how to MAKE IT STOP.

My googling turned up this post at Ask Ubuntu. It has the answer for many linux editors, not just Nano.

The solution for Nano was simply to launch it with the -L option.
nano -L myfile.txt

Category(s): Googling for Answers, Linux
Tags: ,

2 Responses to Stop Nano from adding newline character to end-of-file

  1. It’s also something which can be disabled in the .nanorc config file using ‘set nonewlines’

Leave a Reply

Your email address will not be published. Required fields are marked *

* Copy this password:

* Type or paste password here: