Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you verify what the delimiter for a file is?

I'm using eclipse to edit a script file on my windows system that I use to deploy on my unix server. The script specifies file names and I'd like to be certain that eclipse is saving the files with unix end of line delimiters.

I've set my preferences to use the Unix Line Delimiter on new files using:

Window > Preferences > General > Workspace > "New text file line delimiter"

And have changed my script file's line delimiter using.

File -> Convert Line Delimiters To

Is there a way (preferably with the eclipse IDE) to check that there is no "\r"?

share|improve this question
up vote 1 down vote accepted

Assuming you're not using a version control system like git (which should do this automatically), you can specify which line endings to use for new files in Eclipse.

Window > Preferences > General > Workspace > "New text file line delimiter"

You can also convert an existing file by going to:

File -> Convert Line Delimiters To

In general, its best practice to always use Unix line endings for code that is being used or run on cross-platform environments.

share|improve this answer
Sorry, what I was asking is how do you check what the line delimiter is. I have set the preferences a few times, but still seem to be having issues, so I wanted to verify what the delimiter has been set to. – Michael Merchant Dec 25 '10 at 4:22
In that case, you can use the file utility on *nix systems (OSX included). For Windows, I'd recommend installing cygwin and using file from there. – Andrew M. Dec 25 '10 at 18:28
thanks, the file command is useful on my mac, but it doesn't seem to work in cygwin: bash: file: command not found – Michael Merchant Dec 31 '10 at 0:07
That's because cygwin doesn't install many packages; see the following: – Andrew M. Dec 31 '10 at 1:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.