Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
605 lines (487 loc) · 27 KB
/
Copy pathindex.html
File metadata and controls
605 lines (487 loc) · 27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<meta name="baidu-site-verification" content="NkA6ndXFZC">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css" integrity="sha256-2H3fkXt6FEmrReK448mDVGKb3WW2ZZw35gI7vqHOE4Y=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
<script class="next-config" data-name="main" type="application/json">{"hostname":"www.xi4oyu.top","root":"/","images":"/images","scheme":"Gemini","version":"8.7.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12},"copycode":true,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"gitalk","storage":true,"lazyload":false,"nav":null,"activeClass":"gitalk"},"motion":{"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果:${query}","hits_time":"找到 ${hits} 个搜索结果(用时 ${time} 毫秒)","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>
<meta name="description" content="本文整理了第三周课程有关文件比较的笔记">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux开发环境及应用·第三周·文件比较">
<meta property="og:url" content="http://www.xi4oyu.top/5842b786/index.html">
<meta property="og:site_name" content="feather's blog">
<meta property="og:description" content="本文整理了第三周课程有关文件比较的笔记">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-03-09T08:45:00.000Z">
<meta property="article:modified_time" content="2019-03-09T08:45:00.000Z">
<meta property="article:author" content="feather">
<meta property="article:tag" content="Linux">
<meta property="article:tag" content="学习笔记">
<meta name="twitter:card" content="summary">
<link rel="canonical" href="http://www.xi4oyu.top/5842b786/">
<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://www.xi4oyu.top/5842b786/","path":"5842b786/","title":"Linux开发环境及应用·第三周·文件比较"}</script>
<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Linux开发环境及应用·第三周·文件比较 | feather's blog</title>
<noscript>
<link rel="stylesheet" href="/css/noscript.css">
</noscript>
<link rel="alternate" href="/atom.xml" title="feather's blog" type="application/atom+xml">
</head>
<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
<div class="headband"></div>
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏" role="button">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<i class="logo-line"></i>
<h1 class="site-title">feather's blog</h1>
<i class="logo-line"></i>
</a>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
<i class="fa fa-search fa-fw fa-lg"></i>
</div>
</div>
</div>
<nav class="site-nav">
<ul class="main-menu menu">
<li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
<li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li>
<li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li>
<li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
<li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
<li class="menu-item menu-item-search">
<a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
</a>
</li>
</ul>
</nav>
<div class="search-pop-overlay">
<div class="popup search-popup"><div class="search-header">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocapitalize="off" maxlength="80" placeholder="搜索..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close" role="button">
<i class="fa fa-times-circle"></i>
</span>
</div>
<div class="search-result-container no-result">
<div class="search-result-icon">
<i class="fa fa-spinner fa-pulse fa-5x"></i>
</div>
</div>
</div>
</div>
</div>
<div class="toggle sidebar-toggle" role="button">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
<aside class="sidebar">
<div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">
文章目录
</li>
<li class="sidebar-nav-overview">
站点概览
</li>
</ul>
<div class="sidebar-panel-container">
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
<div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%9B%B8%E5%85%B3%E5%91%BD%E4%BB%A4"><span class="nav-number">1.</span> <span class="nav-text">相关命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#cmp"><span class="nav-number">1.1.</span> <span class="nav-text">cmp</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#md5sum-sha1sum"><span class="nav-number">1.2.</span> <span class="nav-text">md5sum/sha1sum</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#diff"><span class="nav-number">1.3.</span> <span class="nav-text">diff</span></a></li></ol></li></ol></div>
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
<div class="site-overview">
<div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="feather" src="/images/avatar.jpeg">
<p class="site-author-name" itemprop="name">feather</p>
<div class="site-description" itemprop="description">计算机技术&个人琐碎事</div>
</div>
<div class="site-state-wrap site-overview-item animated">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">63</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/">
<span class="site-state-item-count">13</span>
<span class="site-state-item-name">分类</span></a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags/">
<span class="site-state-item-count">42</span>
<span class="site-state-item-name">标签</span></a>
</div>
</nav>
</div>
<div class="links-of-author site-overview-item animated">
<span class="links-of-author-item">
<a href="https://github.com/featherl" title="GitHub → https://github.com/featherl" rel="external nofollow noopener noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
</span>
<span class="links-of-author-item">
<a href="mailto:featherm@126.com" title="E-Mail → mailto:featherm@126.com" rel="external nofollow noopener noreferrer" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
</span>
</div>
<div class="links-of-blogroll site-overview-item animated">
<div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
Links
</div>
<ul class="links-of-blogroll-list">
<li class="links-of-blogroll-item">
<a href="https://0x4qe.github.io/" title="https://0x4qe.github.io/" rel="noopener" target="_blank">0x4qE</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://wzyxv1n.top/" title="https://wzyxv1n.top/" rel="noopener" target="_blank">转爷</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://github.red/" title="https://github.red/" rel="noopener" target="_blank">茄皇</a>
</li>
<li class="links-of-blogroll-item">
<a href="http://fl0.top/" title="http://fl0.top/" rel="noopener" target="_blank">qz</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://legr4ndk.github.io/" title="https://legr4ndk.github.io/" rel="noopener" target="_blank">Legrandk</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://hikawa.ml/" title="https://hikawa.ml/" rel="noopener" target="_blank">Akira</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://ugi57.github.io/" title="https://ugi57.github.io/" rel="noopener" target="_blank">_357</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://altonhe.github.io/" title="https://altonhe.github.io/" rel="noopener" target="_blank">Trotsky</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://www.thesoldierjack.cn/" title="https://www.thesoldierjack.cn/" rel="noopener" target="_blank">digger</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://wr-web.github.io/" title="https://wr-web.github.io/" rel="noopener" target="_blank">wr</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://annevi.cn/" title="https://annevi.cn/" rel="noopener" target="_blank">annevi</a>
</li>
<li class="links-of-blogroll-item">
<a href="http://www.zhouweitong.site/" title="http://www.zhouweitong.site/" rel="noopener" target="_blank">obj</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://blog.wz22.cc/" title="https://blog.wz22.cc/" rel="noopener" target="_blank">Moesang</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://me.liki.link/" title="https://me.liki.link/" rel="noopener" target="_blank">kg</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://cosmos.red/" title="https://cosmos.red/" rel="noopener" target="_blank">boss-c</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://jacksonyu1334.github.io/" title="https://jacksonyu1334.github.io" rel="noopener" target="_blank">jackson</a>
</li>
<li class="links-of-blogroll-item">
<a href="https://cjovi.icu/" title="https://cjovi.icu/" rel="noopener" target="_blank">cj</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</aside>
<div class="sidebar-dimmer"></div>
</header>
<div class="back-to-top" role="button" aria-label="返回顶部">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<noscript>
<div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>
<div class="main-inner post posts-expand">
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="http://www.xi4oyu.top/5842b786/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.jpeg">
<meta itemprop="name" content="feather">
<meta itemprop="description" content="计算机技术&个人琐碎事">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="feather's blog">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
Linux开发环境及应用·第三周·文件比较
</h1>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2019-03-09 16:45:00" itemprop="dateCreated datePublished" datetime="2019-03-09T16:45:00+08:00">2019-03-09</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/MOOC%E8%AF%BE%E7%A8%8B%E5%AD%A6%E4%B9%A0%C2%B7Linux%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E5%8F%8A%E5%BA%94%E7%94%A8/" itemprop="url" rel="index"><span itemprop="name">MOOC课程学习·Linux开发环境及应用</span></a>
</span>
</span>
<span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
<span class="post-meta-item-icon">
<i class="far fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读次数:</span>
<span id="busuanzi_value_page_pv"></span>
</span>
<span class="post-meta-break"></span>
<span class="post-meta-item" title="本文字数">
<span class="post-meta-item-icon">
<i class="far fa-file-word"></i>
</span>
<span class="post-meta-item-text">本文字数:</span>
<span>1.5k</span>
</span>
<span class="post-meta-item" title="阅读时长">
<span class="post-meta-item-icon">
<i class="far fa-clock"></i>
</span>
<span class="post-meta-item-text">阅读时长 ≈</span>
<span>1 分钟</span>
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>本文整理了第三周课程有关文件比较的笔记</p>
<span id="more"></span>
<h2 id="相关命令"><a href="#相关命令" class="headerlink" title="相关命令"></a>相关命令</h2><h3 id="cmp"><a href="#cmp" class="headerlink" title="cmp"></a>cmp</h3><p>该命令用法为:<code>cmp file1 file2</code></p>
<p>该命令会逐字节比较两个文件的内容,当文件内容完全相同的时候,不给出任何的提示,也就是没有输出;当文件不同时,输出第一个不同的位置。</p>
<p>(此命令类似Windows中的COMP命令)</p>
<p>例:<br>有以下文件:</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ <span class="token function">cat</span> test1.txt
aasd
zxcaw
<span class="token number">456</span>
<span class="token number">1234</span>
as
$ <span class="token function">cat</span> test2.txt
aasd
zxcaw
<span class="token number">456</span>
<span class="token number">1234</span>
as
$ <span class="token function">cat</span> test3.txt
<span class="token number">123</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>文件test1.txt和test2.txt内容相同</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ <span class="token function">cmp</span> test1.txt test2.txt
$ <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<p>文件test1.txt和test3.txt内容不同</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ <span class="token function">cmp</span> test1.txt test3.txt
test1.txt test3.txt differ: byte <span class="token number">1</span>, line <span class="token number">1</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<h3 id="md5sum-sha1sum"><a href="#md5sum-sha1sum" class="headerlink" title="md5sum/sha1sum"></a>md5sum/sha1sum</h3><p>md5sum和sha1sum命令分别使用md5和sha-1算法生成文件的hash值,其中md5sum生成16字节hash值,sha1sum生成20字节hash值,通过比较hash值是否相同即可判断文件内容是否相同。</p>
<p>使用方法(以md5sum为例):</p>
<ul>
<li><code>md5sum file1 file2 file3 ...</code> 计算文件的hash值</li>
<li><code>md5sum file1 > test.sum</code> 将生成的test.sum文件放到另一台计算机上运行命令:<code>md5sum -c test.sum</code> 即可验证文件file1的完整性</li>
</ul>
<p>例:<br>计算上面提到的三个文件的hash值</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ md5sum test1.txt test2.txt test3.txt
d08a81eeaf86e095fa5fbbbcb6936344 test1.txt
d08a81eeaf86e095fa5fbbbcb6936344 test2.txt
ba1f2511fc30423bdbb183fe33f3dd0f test3.txt<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<p>验证文件的完整性</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ md5sum test1.txt test2.txt test3.txt <span class="token operator">></span> test.sum
$ md5sum -c test.sum
test1.txt: OK
test2.txt: OK
test3.txt: OK<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h3 id="diff"><a href="#diff" class="headerlink" title="diff"></a>diff</h3><p>此命令用于找出两个文件的差别</p>
<p>基本用法:</p>
<ul>
<li><code>diff file1 file2</code> 使用normal格式输出</li>
<li><code>diff -u file1 file2</code> 使用unified格式输出</li>
</ul>
<p>使用normal输出格式,将列出一个如何将file1转换成file2的指令,具体指令如下:</p>
<ul>
<li>a — add 添加</li>
<li>c — change 改变</li>
<li>d — delete 删除</li>
</ul>
<p>指令字母左边的行号是file1的行号,右面是file2的行号,列出内容的时候,大于号<code>></code>右边的内容是需要在file1文件中增加的内容;小于号<code><</code>右边的内容是需要从file1文件中删除的内容</p>
<p> 举个例子:<br> 现有以下文件:</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ <span class="token function">cat</span> <span class="token number">1</span>.txt
feather
feather
Lee
lee
feather
Linux
$ <span class="token function">cat</span> <span class="token number">2</span>.txt
feather
feather
lee
abc
feather
LInux
hello
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>使用diff命令得到输出:</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">$ <span class="token function">diff</span> <span class="token number">1</span>.txt <span class="token number">2</span>.txt
3d2
<span class="token operator"><</span> Lee
4a4
<span class="token operator">></span> abc
6c6,7
<span class="token operator"><</span> Linux
---
<span class="token operator">></span> LInux
<span class="token operator">></span> hello<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>删除文件file1第3行的内容<code>Lee</code>可得到文件file2的第2行,对应指令为:</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">3d2
<span class="token operator"><</span> Lee<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<p>在文件file1的第4行添加内容<code>abc</code>可以得到文件file2的第4行,对应指令为:</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">4a4
<span class="token operator">></span> abc<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<p>修改文件file1的第6行可变为file2的第6,7行,对应指令为:</p>
<pre class="line-numbers language-shell" data-language="shell"><code class="language-shell">6c6,7
<span class="token operator"><</span> Linux
---
<span class="token operator">></span> LInux
<span class="token operator">></span> hello<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>至于unified格式,这种格式和git版本管理使用的文件比较的输出类似,不详谈。</p>
<p><strong>重要应用</strong>:基于文件比较可以实现版本管理系统</p>
</div>
<footer class="post-footer">
<div class="post-copyright">
<ul>
<li class="post-copyright-author">
<strong>原作者: </strong>feather
</li>
<li class="post-copyright-link">
<strong>本文链接:</strong>
<a href="http://www.xi4oyu.top/5842b786/" title="Linux开发环境及应用·第三周·文件比较">http://www.xi4oyu.top/5842b786/</a>
</li>
<li class="post-copyright-license">
<strong>版权声明: </strong>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" rel="external nofollow noopener noreferrer" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处!
</li>
</ul>
</div>
<div class="followme">
<span>欢迎关注我的其它发布渠道</span>
<div class="social-list">
<div class="social-item">
<a target="_blank" class="social-link" href="/atom.xml">
<span class="icon">
<i class="fa fa-rss"></i>
</span>
<span class="label">RSS</span>
</a>
</div>
</div>
</div>
<div class="post-tags">
<a href="/tags/Linux/" rel="tag"># Linux</a>
<a href="/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" rel="tag"># 学习笔记</a>
</div>
<div class="post-nav">
<div class="post-nav-item">
<a href="/3b96e352/" rel="prev" title="redis未授权访问批量验证脚本编写[python]">
<i class="fa fa-chevron-left"></i> redis未授权访问批量验证脚本编写[python]
</a>
</div>
<div class="post-nav-item">
<a href="/e411af14/" rel="next" title="Linux开发环境及应用·第三周·vi编辑器">
Linux开发环境及应用·第三周·vi编辑器 <i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
</footer>
</article>
</div>
<div class="comments gitalk-container"></div>
</div>
</main>
<footer class="footer">
<div class="footer-inner">
<div class="copyright">
©
<span itemprop="copyrightYear">2022</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">feather</span>
</div>
<div class="wordcount">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-chart-line"></i>
</span>
<span title="站点总字数">380k</span>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-coffee"></i>
</span>
<span title="站点阅读时长">5:46</span>
</span>
</div>
<div class="busuanzi-count">
<span class="post-meta-item" id="busuanzi_container_site_uv">
<span class="post-meta-item-icon">
<i class="fa fa-user"></i>
</span>
<span class="site-uv" title="总访客量">
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
<span class="post-meta-item" id="busuanzi_container_site_pv">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="site-pv" title="总访问量">
<span id="busuanzi_value_site_pv"></span>
</span>
</span>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>
<script src="/js/third-party/search/local-search.js"></script>
<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.css" integrity="sha256-AJnUHL7dBv6PGaeyPQJcgQPDjt/Hn/PvYZde1iqfp8U=" crossorigin="anonymous">
<script class="next-config" data-name="gitalk" type="application/json">{"enable":true,"github_id":"featherl","repo":"BlogComment","client_id":"675720f495795eee8627","client_secret":"969c2822176976bcb997f7d6fd07767ce6356043","admin_user":"featherl","distraction_free_mode":true,"proxy":"https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token","language":"zh-CN","js":{"url":"https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.min.js","integrity":"sha256-Pmj85ojLaPOWwRtlMJwmezB/Qg8BzvJp5eTzvXaYAfA="},"path_md5":"e0c1c006edc53ae2d3e751c35ccfe732"}</script>
<script src="/js/third-party/comments/gitalk.js"></script>
</body>
</html>