惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News | PayPal Newsroom
P
Proofpoint News Feed
Cyberwarzone
Cyberwarzone
C
Cisco Blogs
SecWiki News
SecWiki News
Know Your Adversary
Know Your Adversary
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
NISL@THU
NISL@THU
WordPress大学
WordPress大学
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Threat Research - Cisco Blogs
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
Security Archives - TechRepublic
Security Archives - TechRepublic
有赞技术团队
有赞技术团队
L
LINUX DO - 热门话题
Hacker News: Ask HN
Hacker News: Ask HN
V
V2EX
G
GRAHAM CLULEY
TaoSecurity Blog
TaoSecurity Blog
Hugging Face - Blog
Hugging Face - Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
Latest news
Latest news
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
T
Troy Hunt's Blog
S
Schneier on Security
I
Intezer
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
爱范儿
爱范儿
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
美团技术团队
B
Blog RSS Feed

博客园 - SmilingEye

每天5分钟,用碎片时间搞定软考系统架构设计师600词 2025年9月Java后端招聘市场技术风向标:666份招聘数据深度解读 微信小程序PDF签名 DBLock 面试题:ReentrantLock 实现原理 docker 升级(软件包离线方式) tomcat设置https 使用fastjson时spring security oauth2获取token格式变化 springboot之cookie操作 linux修改权限后git pull出现冲突 JWT简介 jenkins之SSH Publishers连接windows Windows安装OpenSSH服务 jenkins从远程服务器下载 重写mybatis的字符串类型处理器 mybatis-sqlite日期类型对应关系 docker安装postgresql docker常用命令 java sqlite docker,sqlite出错
使用sed将win换行符转linux与linux换行符转win
SmilingEye · 2020-01-19 · via 博客园 - SmilingEye

1.一些概念

  • windows换行符\r\n,也是CRLF
  • linux换行符\n,也是LF

2.windows上使用Notepad++查看换行符

视图-》显示符号-》显示行尾符

3.使用sed将win换行符转linux换行符

命令的意思是将\r去掉

-i直接修改filename文件

s是替换的意思,例如:s/旧字符串/新字符串/

4.使用sed将linux换行符转windows换行符

sed -i ':label;N;s/\n/;/;b label' filename
sed -i 's/;/\r\n/g' filename

先使用第一句将换行\n替换为;

再使用第二句将;替换为\r\n

为什么不用3的方式将\n换成\r\n,因为sed是按行读取并且不包含换行符\r

去掉linux换行符:

https://www.cnblogs.com/lykm02/p/4479098.html

sed参数:

https://www.cnblogs.com/maxincai/p/5146338.html

sed两个空间:

https://www.cnblogs.com/276815076/p/7879666.html