नोट जाना आप लेने की जरूरत अतिरिक्त देखभाल, और शायद सही iconv का उपयोग करने या एन्कोडिंग विनिर्देशों से रिकोड करने का प्रयास करना चाहिए।
यदि यह एक सादा ASCII फ़ाइल है, तो निम्न दोनों विधियां काम करेंगी।
flip
प्रोग्राम, डेबियन में पैकेज को flip
भी कहा जाता है, जो लाइन-एंडिंग को संभाल सकता है। मैनुअल से:
When asked to convert a file to the same format that it already
has, flip causes no change to the file. Thus to convert all
files to **IX format you can type
flip -u *
and all files will end up right, regardless of whether they were
in MS-DOS or in **IX format to begin with. This also works in the
opposite direction.
या आप इस्तेमाल कर सकते हैं जीएनयू recode:
< /etc/passwd recode ..pc | tee a b > /dev/null
file a b
आउटपुट:
a: ASCII text, with CRLF line terminators
b: ASCII text, with CRLF line terminators
यूनिक्स लाइन अंत में परिवर्तित करें:
recode pc.. a b
file a b
आउटपुट:
a: ASCII text
b: ASCII text
recode pc
रूप abbreviates डॉस लाइन अंत है, तो pc..
साथ तर्क: डिफ़ॉल्ट रूप है, जो यूनिक्स लाइन अंत के साथ latin1 है पीसी प्रारूप से परिवर्तित करते हैं।
grep -URl^एम। | xargs fromdos? – Dalinaum
स्थापना के लिए उबंटू पैकेज को "tofrodos" कहा जाता है। – Apalala
tcsh पर, और शायद csh पर भी, आप 'grep -URl "\ r" के साथ समान प्रभाव प्राप्त कर सकते हैं। | xargs fromdos'। – bdesham