Swimminginthought

A place for all things technical and my mind..

Menu
  • About Me / Hire Me
Menu

Linux and File Editing

Posted on May 11, 2012 by Percy Kwong

When you need to edit a file on Linux, it is highly recommended that you use a linux text editor.  If you’re using a windows machine or something else, the editor you use might introduce carriage return characters into the end of every line.  This can prove to be a problem as it WILL wreak havoc on your system.

I recommend and like vi, because it’s powerful and is installed by default on every linux system, however, if you don’t have access to the linux box, might I suggest you install cygwin and use vi from cygwin to actually do the editing and just upload the file.

While vi is hard to use, there is a post on this blog about using vi as well as the ability to borrow the book using kindle on Amazon.com

There are other alternatives:

nano:   a very easy to use text editor.

emacs: if you’re going to learn emacs, you might as well learn vi.  The learning curve is steep, but if you’re going to do it, do it on something you’ll use across many platforms and is guaranteed to be there on every linux distribution.

vim:  a jazzed up version of vi.  While I like vim, it’s not the default install and I just prefer to use whatever is there.

If you must use something, I suggest using notepad or wordpad.  If the formatting looks horrible in notepad, load the file into wordpad.

After you have edited the file, upload to the server and run:  dos2unix filename  filename.converted

then type cat filename.converted to make sure it is a good looking file.  then delete the initial file and rename filename.converted to filename.

 

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Kubernetes install gotcha on CentOS-7.x
  • Infrastructure as Code using AWS Cloudformation
  • Does SSL matter? It does and it’s not just web encryption.
  • Apache can’t serve the .well-known directory
  • Cloudy with a chance of Meatballs
  • Resurrection of the Blog
  • Encryption type Matters with Deep Packet Inspection – solved
  • Completely off topic.. Just a personal note.
©2025 Swimminginthought | Built using WordPress and Responsive Blogily theme by Superb