5/3/12

Find If the file is in Unix format or DOS format :


We can find by using the 'od' command and 'grep' for carriage returns('\r') that usually exist in DOS format files.
Example : od -c filename.txt| grep'\\r'
if it won't show up anything then it is in Unix format.
Or we can use the following method also :
Example : grep -c '^M$' filename 
Note that ^M has to be typed with control-v and enter(Not by typing shift 6 and M)

0 comments:

Post a Comment