title: What is newline character -- '\n'
body: <p>This is a very basic concept, but something I have never been able to articulate that well. and I would like to try to spell it and see where I go wrong.</p>
  
  <p>If I have to, how would I define a "newline character". say if I create a new file in unix(or windows), then does the file store the "end of line" information by inserting a special character in the file called as "new line character". If so, what is its ascii value? I remember that in C programs, I have checked for the read character against the value '\n' . And why this confusing 2 characters to represent end of line characters..</p>
  
  <pre><code>bash$ cat states
  California
  Massachusetts
  Arizona
  </code></pre>
  
  <p>Say, I want to insert one line space between the lines and want an output of the form:
      Desired output:</p>
  
  <pre><code>California
  
  Massachusetts
  
  Arizona
  
  bash$sed -e 's/\n/\n\n/g' states  does not work.
  </code></pre>
  
  <p>Why can't I treat "new line character" here just as I would treat any other character and run something like above command. (I understand that one might say that this is a matter of syntax of sed, but could one please explain the intuition behind not allowing this, so that I can get rid of my confusion.</p>
  
  <p>Similarly, inside the vim editor, I can not use :%s/\n/\n\n/g    . Why so?</p>
  
  <p>Do I need to further escape \n by using a backslash in sed and from within vim?.</p>
  
  <p>Thanks,</p>
  
  <p>Jagrati</p>