Difference between ascii and binary file -

what is the diff between ascii and binary file.

my understand is that..

ascii file - has only line feed - \n in it
where as
binary file - has both line feed and carriage return in it- \r\n

is that correct.

also,what is the ksh command to identify whether it is a binary or ascii file..

when i say

file <filename>, it only says it is a data file.

how do i findout if a file is binary or ascii.

The ASCII char set is composed of (binary) codes from 0 to 127, including control chars, punctuation, numbers, and upper and lower case characters. Anything above does not belong to the ASCII set, but e.g. an extended ASCII set, or UTF-8, or other.
An ASCII text will be composed of lines containing only the codes below 128, but can include any control char, incl. \r. It's a unix convention to only use \n for a line separator. Other OS, like Windows or VMS, use(d) \r\n as line terminators in text files.
Any file that has codes above 128 CAN be a text file using an international char set like UTF-8, but also can be a binary file, e.g. a picture, a sound file, or a database file. (Actually, you could have a picture that has only codes below 128, but that might be a bit strange to look at...)