The latest tool unix2dos for batch file format conversion in CentOS

Source: Internet
Author: User

The latest tool unix2dos for batch file format conversion in CentOS
Installation:
Yum install dos2unix unix2dos
Ubuntu is different. It seems like this: $ sudo aptitude install tofrodos
Unix2dos corresponds to todos dos2unix and fromdos

Option and parameter:-k: Retain the original mtime format of the file (the last modified time of the file is not updated)
-N: Retain the original file and output the converted content to the new file, for example, dos2unix-n old new
Example: 1. All files are converted from dos to unix. In a unix system, you can view the converted file format by using the file name.
Format: dos2unix file

2. One-time conversion of multiple file formats:
Format: dos2unix file1 file2 file3

3. During the above conversion, it will be directly modified on the original file. If you want to save the Conversion Result to another file without changing the source file, you can use the-n parameter.
Format: dos2unix-n oldfile newfile

4. If you want to keep the file timestamp unchanged, add the-k parameter. Therefore, you can add the-k parameter to the preceding commands to keep the file timestamp.
Format: dos2unix-k file
Format: dos2unix-k file1 file2 file3

If it is a script file generated under Windows, it cannot be run directly after it is uploaded to unix, and you need to run the above command to complete the file format transformation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.