vim设置line ending
今天在新VPS上设置防火墙时,下面导入规则的命令总是报一个错
1 2 3 4 5 |
sudo iptables-restore < v4.rules 'ptables-restore v1.4.21: iptables-restore: unable to initialize table 'filter Error occurred at line: 1 Try `iptables-restore -h' or 'iptables-restore --help' for more information. |
经google,发现是规则文件的line ending没有保存为unix格式,在linux上可以用vim设置line ending为正确格式
1 2 3 |
:set ff=unix # 设为linux的Line Ending :set ff=dos # 设为windows的Line Ending :set ff=mac # 设为mac的Line Ending |
本文出自扉启博客,转载时请注明出处及相应链接。
本文永久链接: https://www.feiqy.com/vim-line-ending/
近期评论