Linux command
unix2dos 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Change
unix2dos [path/to/file]
Create
unix2dos -n [path/to/file] [path/to/new_file]
Display
unix2dos -i [path/to/file]
Keep/add/remove
unix2dos --keep-bom|--add-bom|--remove-bom [path/to/file]
说明
unix2dos converts text files from Unix line ending format (LF) to DOS/Windows format (CRLF). It modifies files in place by default or can write to new files with the -n option. The tool is commonly used when preparing files for Windows systems or when working with cross-platform projects that require consistent line endings.
参数
- -n, --newfile _infile_ _outfile_
- Write to new file instead of modifying in place
- -i, --info _flags_
- Display file information (line endings, BOM)
- -k, --keepdate
- Keep output file date same as input
- --keep-bom
- Keep Byte Order Mark
- --add-bom
- Add Byte Order Mark
- --remove-bom
- Remove Byte Order Mark
- -q, --quiet
- Quiet mode, suppress warnings
FAQ
What is the unix2dos command used for?
unix2dos converts text files from Unix line ending format (LF) to DOS/Windows format (CRLF). It modifies files in place by default or can write to new files with the -n option. The tool is commonly used when preparing files for Windows systems or when working with cross-platform projects that require consistent line endings.
How do I run a basic unix2dos example?
Run `unix2dos [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n, --newfile _infile_ _outfile_ do in unix2dos?
Write to new file instead of modifying in place