签到成功

知道了

CNDBA社区CNDBA社区

Linux下安装dos2unix

2022-02-16 10:06 1388 0 原创 Linux
作者: hbhe0316

在windows下拷贝文件至Linux系统,可能会涉及到dos to unix格式转化,

http://www.cndba.cn/hbhe0316/article/107734
http://www.cndba.cn/hbhe0316/article/107734http://www.cndba.cn/hbhe0316/article/107734http://www.cndba.cn/hbhe0316/article/107734http://www.cndba.cn/hbhe0316/article/107734

1.通常可以在vi编辑器里面设置
set ff ?查看文件格式
set ff = unix解决http://www.cndba.cn/hbhe0316/article/107734http://www.cndba.cn/hbhe0316/article/107734http://www.cndba.cn/hbhe0316/article/107734

2.还有可以按照dos2unix小工具http://www.cndba.cn/hbhe0316/article/107734

http://www.cndba.cn/hbhe0316/article/107734

[root@node01:/tmp]$ yum install dos2unix
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
centos7_9                                                                                                                                                                              | 2.9 kB  00:00:00
epel-release                                                                                                                                                                           | 2.9 kB  00:00:00
nginx                                                                                                                                                                                  | 2.9 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package dos2unix.x86_64 0:6.0.3-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================
 Package                                          Arch                                           Version                                              Repository                                         Size
==============================================================================================================================================================================================================
Installing:
 dos2unix                                         x86_64                                         6.0.3-7.el7                                          centos7_9                                          74 k

Transaction Summary
==============================================================================================================================================================================================================
Install  1 Package

Total download size: 74 k
Installed size: 190 k
Is this ok [y/d/N]: y
Downloading packages:
dos2unix-6.0.3-7.el7.x86_64.rpm                                                                                                                                                        |  74 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : dos2unix-6.0.3-7.el7.x86_64                                                                                                                                                                1/1
  Verifying  : dos2unix-6.0.3-7.el7.x86_64                                                                                                                                                                1/1

Installed:
  dos2unix.x86_64 0:6.0.3-7.el7

Complete!
[root@node01:/tmp]$ which dos2unix
/bin/dos2unix

版权声明:本文为博主原创文章,未经博主允许不得转载。

Linux

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1039209次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ