-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux-bash.html
More file actions
800 lines (689 loc) · 55.9 KB
/
linux-bash.html
File metadata and controls
800 lines (689 loc) · 55.9 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
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Linux 私房菜:走进 bash | happyJared - 博客</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="happyJared - 博客。保持勤學習的心,做好寫代碼這事。公众号:超级码里奥" />
<meta name="description" content="本文内容精简、整理、摘抄、有感于《鸟哥的Linux私房菜 - 基础篇第四版》第十章 • 认识与学习BASH。 Bash功能 命令编辑修复能力:history。用户bash指令使用记录文件:~/.bash_history 命令与文件补全:tab 命令别名设定:alias 工作控制、前景和背景控制 程序化脚本:shell scripts 通配符:wildcard 指令操作 快捷">
<meta name="keywords" content="bash">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux 私房菜:走进 bash">
<meta property="og:url" content="https://blog.mariojd.cn/linux-bash.html">
<meta property="og:site_name" content="happyJared - 博客">
<meta property="og:description" content="本文内容精简、整理、摘抄、有感于《鸟哥的Linux私房菜 - 基础篇第四版》第十章 • 认识与学习BASH。 Bash功能 命令编辑修复能力:history。用户bash指令使用记录文件:~/.bash_history 命令与文件补全:tab 命令别名设定:alias 工作控制、前景和背景控制 程序化脚本:shell scripts 通配符:wildcard 指令操作 快捷">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://image.mariojd.cn/happyjared/20181018/20181018141303.png">
<meta property="og:updated_time" content="2019-06-02T11:41:35.969Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Linux 私房菜:走进 bash">
<meta name="twitter:description" content="本文内容精简、整理、摘抄、有感于《鸟哥的Linux私房菜 - 基础篇第四版》第十章 • 认识与学习BASH。 Bash功能 命令编辑修复能力:history。用户bash指令使用记录文件:~/.bash_history 命令与文件补全:tab 命令别名设定:alias 工作控制、前景和背景控制 程序化脚本:shell scripts 通配符:wildcard 指令操作 快捷">
<meta name="twitter:image" content="http://image.mariojd.cn/happyjared/20181018/20181018141303.png">
<link rel="icon" href="/favicon.ico">
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/style.css">
<script src="/js/pace.min.js"></script>
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-127138870-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?7d6076888c62ff336f5b580c57fd4141";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<div style="display: none;">
<script src="//s22.cnzz.com/z_stat.php?id=1274993267&web_id=1274993267" language="JavaScript"></script>
</div>
</head>
<body>
<div id="container">
<header id="header">
<!--<div id="banner"></div>-->
<div id="header-outer">
<div id="header-menu" class="header-menu-pos animated">
<div class="header-menu-container">
<a href="/" class="left">
<span class="site-title"></span>
</a>
<nav id="header-menu-nav" class="right">
<a href="/">
<i class="fa fa-h-square"></i>
<span>主页</span>
</a>
<a href="/life">
<i class="fa fa-battery-three-quarters"></i>
<span>岁月</span>
</a>
<a target="_blank" href="https://mp.mariojd.cn">
<i class="fa fa-dot-circle-o"></i>
<span>洞见</span>
</a>
<a href="/archives">
<i class="fa fa-window-restore"></i>
<span>归档</span>
</a>
<a target="_blank" href="http://jianshu.mariojd.cn">
<i class="fa fa-superpowers"></i>
<span>简统</span>
</a>
<a href="/about">
<i class="fa fa-user"></i>
<span>关于</span>
</a>
</nav>
<a class="mobile-header-menu-button">
<i class="fa fa-bars"></i>
</a>
</div>
</div>
<div id="header-row">
<div id="logo">
<a href="/">
<img src="/images/logo.png" alt="logo">
</a>
</div>
<div class="header-info">
<!--<div id="header-title">-->
<!---->
<!--</div>-->
<div id="header-description">
<div id="hitokoto" style="height:24px;line-height:24px;">
保持勤學習的心,做好寫代碼這事
</div>
</div>
</div>
<nav class="header-nav">
<div class="social">
<a title="github" target="_blank" href="//github.com/happyjared">
<i class="fa fa-github fa-2x"></i></a>
<a title="简书" target="_blank" href="//www.jianshu.com/u/000a530f461c">
<i class="fa fa-book fa-2x"></i></a>
<a title="企鹅号" target="_blank" href="//wpa.qq.com/msgrd?v=3&uin=1394223902&site=qq&menu=yes">
<i class="fa fa-qq fa-2x"></i></a>
<a title="公众号" target="_blank" href="//image.mariojd.cn/qrcode_for_supermmario_1280.jpg">
<i class="fa fa-wechat fa-2x"></i></a>
</div>
</nav>
</div>
</div>
</header>
<div class="outer">
<section id="main" class="body-wrap"><article id="post-Linux 私房菜:走进bash" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 class="post-title" itemprop="name">
Linux 私房菜:走进 bash
</h1>
<div class="post-title-bar">
<ul>
<li>
<i class="fa fa-book"></i>
<a href="/categories/Linux/">Linux</a>
</li>
<li>
<i class="fa fa-calendar"></i> 2018-10-18
</li>
<li>
<i class="fa fa-eye"></i>
<span id="busuanzi_value_page_pv"></span>
</li>
</ul>
</div>
</header>
<div class="article-entry post-content" itemprop="articleBody">
<!--
self_category:
self_tags:
osChina_sys_category:
csdn_article_category:
csdn_blog_category:
-->
<blockquote>
<p>本文内容精简、整理、摘抄、有感于《鸟哥的Linux私房菜 - 基础篇第四版》第十章 • 认识与学习BASH。</p>
</blockquote>
<h3 id="Bash功能"><a href="#Bash功能" class="headerlink" title="Bash功能"></a>Bash功能</h3><ul>
<li><p>命令编辑修复能力:<code>history</code>。用户bash指令使用记录文件:<code>~/.bash_history</code></p>
</li>
<li><p>命令与文件补全:<code>tab</code></p>
</li>
<li><p>命令别名设定:<code>alias</code></p>
</li>
<li><p>工作控制、前景和背景控制</p>
</li>
<li><p>程序化脚本:shell scripts</p>
</li>
<li><p>通配符:wildcard</p>
</li>
</ul>
<h3 id="指令操作"><a href="#指令操作" class="headerlink" title="指令操作"></a>指令操作</h3><table>
<thead>
<tr>
<th>快捷键</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>backspace</code></td>
<td>向前删除指令</td>
</tr>
<tr>
<td><code>ctrl + u</code></td>
<td>向前删除全部指令</td>
</tr>
<tr>
<td><code>del</code></td>
<td>向后删除指令</td>
</tr>
<tr>
<td><code>ctrl + k</code></td>
<td>向后删除全部指令</td>
</tr>
<tr>
<td><code>ctrl + a</code> 或 <code>home</code></td>
<td>移动到指令串最前面</td>
</tr>
<tr>
<td><code>ctrl + e</code> 或 <code>end</code></td>
<td>移动到指令串最末尾</td>
</tr>
</tbody>
</table>
<h3 id="变量使用"><a href="#变量使用" class="headerlink" title="变量使用"></a>变量使用</h3><ol>
<li><p>在终端输入,如设定<code>a=b</code>(不能以数字开头,等号两边不能有空格),那么可以使用<code>echo</code>指令取出值b:<code>echo $a</code>,这种设定仅对本次登录有效;</p>
</li>
<li><p>常见的环境变量有<code>$HOME</code>、<code>$PATH</code>等,可用<code>env</code>、<code>set</code>或<code>export</code>命令查找已定义的变量;</p>
</li>
</ol>
<ul>
<li>打印本shell的PID:<code>echo $$</code></li>
<li>打印上一个指令的回传值:<code>echo $?</code>(正常回传为0)</li>
</ul>
<ol>
<li><p>取消变量设定:<code>unset a</code>;</p>
</li>
<li><p>双引号字符串中,仍可引用变量,而单引号字符串仅代表是字符串本身。</p>
</li>
</ol>
<h3 id="相关命令"><a href="#相关命令" class="headerlink" title="相关命令"></a>相关命令</h3><table>
<thead>
<tr>
<th>命令</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>alias</code></td>
<td>设定别名</td>
</tr>
<tr>
<td><code>unalias</code></td>
<td>取消设定别名</td>
</tr>
<tr>
<td><code>history</code></td>
<td>查看历史命令。<code>!number</code>,执行第n个指令;<code>!command</code>,往前模糊搜索匹配的指令并执行;<code>!!</code>,执行上一个指令,相当于<code>↑ + Enter</code></td>
</tr>
<tr>
<td><code>ctrl + u</code></td>
<td>提示符命令输入下可快速删除整行</td>
</tr>
<tr>
<td><code>ctrl + s</code></td>
<td>暂停屏幕的输出</td>
</tr>
<tr>
<td><code>ctrl + q</code></td>
<td>恢复屏幕的输出</td>
</tr>
</tbody>
</table>
<h3 id="特殊符号"><a href="#特殊符号" class="headerlink" title="特殊符号"></a>特殊符号</h3><table>
<thead>
<tr>
<th>bash特殊符号</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>#</td>
<td>批注符号:注释</td>
</tr>
<tr>
<td>\</td>
<td>跳脱符号:将特殊字符或通配符还原成一般字符</td>
</tr>
<tr>
<td>|</td>
<td>管线:连接两个管线命令</td>
</tr>
<tr>
<td>;</td>
<td>分隔多个连续性命令</td>
</tr>
<tr>
<td>~</td>
<td>当前用户的家目录</td>
</tr>
<tr>
<td>$</td>
<td>取用变量前导符</td>
</tr>
<tr>
<td>&</td>
<td>工作控制:将指令设为后台工作</td>
</tr>
<tr>
<td>/</td>
<td>目录间的分隔符</td>
</tr>
<tr>
<td>!</td>
<td>逻辑运算符:非,not</td>
</tr>
<tr>
<td>>, >></td>
<td>数据流输出重导向,前者是覆盖追加,后者是累记追加</td>
</tr>
<tr>
<td><, <<</td>
<td>数据流输入重导向</td>
</tr>
<tr>
<td>‘xxx’</td>
<td>单引号确保了当前引用的肯定为字符串</td>
</tr>
<tr>
<td>“xxx”</td>
<td>双引号仍具有变量置换功能(如$可保留相关变量引用)</td>
</tr>
<tr>
<td>`xxx`</td>
<td>可执行的指令,亦可使用$()</td>
</tr>
<tr>
<td>()</td>
<td>中间为子shell的起始和结束</td>
</tr>
<tr>
<td>{}</td>
<td>中间为命令区块的结合</td>
</tr>
<tr>
<td>cmd1 && cmd2</td>
<td>cmd2仅在cmd1正确执行的情况下执行</td>
</tr>
<tr>
<td>cmd1 || cmd2</td>
<td>cmd2仅在cmd1执行错误的情况下执行</td>
</tr>
</tbody>
</table>
<h3 id="数据流重导向"><a href="#数据流重导向" class="headerlink" title="数据流重导向"></a>数据流重导向</h3><ul>
<li><p>标准输入(stdin,standard input): 代码为0,使用 <code><</code> 或 <code><<</code></p>
</li>
<li><p>标准输出(stdout,standard output):指令正确执行所回传的讯息。代码为1,使用 <code>></code> 或 <code>>></code></p>
</li>
<li><p>标准错误输出(stderr,standard error output):指令执行失败后,所回传的讯息。代码为2,使用 <code>2></code> 或 <code>2>></code></p>
</li>
<li><p>垃圾桶黑洞:<code>/dev/null</code></p>
</li>
</ul>
<h3 id="提取命令"><a href="#提取命令" class="headerlink" title="提取命令"></a>提取命令</h3><ul>
<li><p><code>cut [-dfc]</code>,将输入讯息的某一段切出来 (<strong>不适合处理多空格或无规则的数据</strong>)</p>
<ul>
<li><code>d</code>后接指定分隔符,与<code>-f</code>一起使用</li>
<li><code>f</code>分段后,这个代表第几段(以1开始,同时取出多段以<code>,</code>分隔),<code>echo $PATH | cut -d ":" -f 4,5,6</code></li>
<li><code>c</code>以字符为单位取出行的固定字符区间,后接区间范围,如<code>10-</code>表示取出第10个字符到最后,<code>export | cut -c 12-</code></li>
</ul>
</li>
<li><p><code>grep [-acinvAB] [--color=auto] '搜寻字符串' filename</code></p>
<ul>
<li><code>a</code>将binary文件转成text文件后再搜索</li>
<li><code>c</code>计算出现次数</li>
<li><code>i</code>忽略大小写</li>
<li><code>n</code>输出行号</li>
<li><code>v</code>反向选择未搜索匹配到的</li>
<li><code>An</code>列出该行之后的n行</li>
<li><code>Bn</code>列出该行之前的n行</li>
</ul>
</li>
</ul>
<h3 id="排序命令"><a href="#排序命令" class="headerlink" title="排序命令"></a>排序命令</h3><ul>
<li><p><code>sort [-fbMnrtuk] [file or stdin]</code></p>
<ul>
<li><code>f</code>忽略大小写</li>
<li><code>b</code>忽略前面的空格</li>
<li><code>M</code>按月份排序</li>
<li><code>n</code>按数字排序</li>
<li><code>r</code>反向排序</li>
<li><code>u</code>去重,相同数据仅出现一行</li>
<li><code>t</code>指定分隔符</li>
<li><code>k</code>按指定区间排序,<code>cat /etc/passwd | sort -t ':' -k 3</code></li>
</ul>
</li>
<li><p><code>wc [-lwm]</code>,数据统计</p>
<ul>
<li><code>l</code>统计行</li>
<li><code>w</code>统计英文单字</li>
<li><code>m</code>统计字符</li>
</ul>
</li>
<li><p><code>uniq [-c]</code>,去重,<code>c</code>代表统计次数</p>
</li>
</ul>
<h3 id="双向重导向"><a href="#双向重导向" class="headerlink" title="双向重导向"></a>双向重导向</h3><ul>
<li><code>tee [-a] file</code>,用于同时将数据流分送到文件和屏幕,而类似<code>></code>和<code>>></code>只能输送到文件,<code>-a</code>参数代表追加</li>
</ul>
<h3 id="字符转换"><a href="#字符转换" class="headerlink" title="字符转换"></a>字符转换</h3><ul>
<li><p><code>tr [-ds]</code>,用于将删除或替换某一讯息中的文字</p>
<ul>
<li><code>d</code>后接某一字符用于删除</li>
<li><code>s</code>后接被替换的字符和待取代的字符</li>
</ul>
</li>
<li><p><code>col [-xb]</code>,将<code>tab</code>键转换成对等的空格键</p>
</li>
<li><p><code>join -[til2] file1 file2</code>,处理两个文字的数据</p>
</li>
<li><p><code>paste [-d] file1 file2</code>,以<code>tab</code>键分隔将两文件的对应每一行合并成一行,<code>-d</code>参数可以指定分隔符</p>
</li>
<li><p><code>expand [-t] file</code>,将空格键转换成对等的<code>tab</code>键,<code>-t</code>参数可以指定一个<code>tab</code>键代表多少个字符</p>
</li>
</ul>
<h3 id="分区命令"><a href="#分区命令" class="headerlink" title="分区命令"></a>分区命令</h3><ul>
<li><code>split -[bl] file [PREFIX]</code>,<code>-b</code>参数后接分区文件大小,可指定b,k,m,g等;<code>-l</code>参数为以行数进行分区;<code>PREFIX</code>指定分区文件名前缀</li>
</ul>
<h3 id="参数替换"><a href="#参数替换" class="headerlink" title="参数替换"></a>参数替换</h3><ul>
<li><code>xargs -[0epn] command</code>,产生某个指令的参数</li>
</ul>
<h3 id="减号用途"><a href="#减号用途" class="headerlink" title="减号用途"></a>减号用途</h3><p>减号<code>-</code>可用于连接一些特殊的stdin和stdout,像这个文件压缩和解压缩的示例:<code>tar -cvf - /home | tar -xvf - -C /tmp/home</code>。前面的<code>-</code>用于将stdout传到后面,而后面那个<code>-</code>则用于接收stdout,这样就可以免去要生成file的流程</p>
<h3 id="重点回顾"><a href="#重点回顾" class="headerlink" title="重点回顾"></a>重点回顾</h3><p><img src="http://image.mariojd.cn/happyjared/20181018/20181018141303.png" alt="重点回顾"></p>
<blockquote>
<p>欢迎关注我的个人公众号:超级码里奥<br>如果这对您有帮助,欢迎点赞和分享,转载请注明出处 </p>
</blockquote>
<div class="post-copyright">
<div class="content">
<p>最后更新: 2019年06月02日 19:41</p>
<p>原始链接: <a class="post-url" href="/linux-bash.html" title="Linux 私房菜:走进 bash">https://blog.mariojd.cn/linux-bash.html</a></p>
<footer>
<a href="https://blog.mariojd.cn">
<img src="/images/logo.png" alt="happyJared">
happyJared
</a>
</footer>
</div>
</div>
<div class="page-reward">
<a id="rewardBtn" href="javascript:;">赏</a>
</div>
<div id="reward" class="post-modal reward-lay">
<a class="close" href="javascript:;" id="reward-close">×</a>
<span class="reward-title">
<i class="icon icon-quote-left"></i>
支持创作
<i class="icon icon-quote-right"></i>
</span>
<div class="reward-content">
<div class="reward-code">
<img id="rewardCode" src="/images/wechat_code.jpg" alt="打赏二维码">
</div>
<div class="reward-select">
<label class="reward-select-item checked" data-id="wechat" data-wechat="/images/wechat_code.jpg">
<img class="reward-select-item-wechat" src="/images/wechat.png" alt="微信">
</label>
<label class="reward-select-item" data-id="alipay" data-alipay="/images/alipay_code.jpg">
<img class="reward-select-item-alipay" src="/images/alipay.png" alt="支付宝">
</label>
</div>
</div>
</div>
</div>
<footer class="article-footer">
<div class="post-share">
<a href="javascript:;" id="share-sub" class="post-share-fab">
<i class="fa fa-share-alt"></i>
</a>
<div class="post-share-list" id="share-list">
<ul class="share-icons">
<li>
<a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://blog.mariojd.cn/linux-bash.html&title=《Linux 私房菜:走进 bash》 — happyJared - 博客&pic=https://image.mariojd.cn/happyjared/20181018/linux-bash.jpg" data-title="微博">
<i class="fa fa-weibo"></i>
</a>
</li>
<li>
<a class="weixin share-sns" id="wxFab" href="javascript:;" data-title="微信">
<i class="fa fa-weixin"></i>
</a>
</li>
<li>
<a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://blog.mariojd.cn/linux-bash.html&title=《Linux 私房菜:走进 bash》 — happyJared - 博客&source=Java developer, like Python and Javascript too,为人乐观、积极、向上、勤奋、和善、好相处,讲卫生,爱学习,爱..." data-title="QQ">
<i class="fa fa-qq"></i>
</a>
</li>
<li>
<a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://blog.mariojd.cn/linux-bash.html" data-title="Facebook">
<i class="fa fa-facebook"></i>
</a>
</li>
<li>
<a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《Linux 私房菜:走进 bash》 — happyJared - 博客&url=https://blog.mariojd.cn/linux-bash.html&via=https://blog.mariojd.cn" data-title="Twitter">
<i class="fa fa-twitter"></i>
</a>
</li>
<li>
<a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://blog.mariojd.cn/linux-bash.html" data-title="Google+">
<i class="fa fa-google-plus"></i>
</a>
</li>
</ul>
</div>
</div>
<div class="post-modal wx-share" id="wxShare">
<a class="close" href="javascript:;" id="wxShare-close">×</a>
<p>扫一扫,分享到微信</p>
<img src="//api.qrserver.com/v1/create-qr-code/?data=https://blog.mariojd.cn/linux-bash.html" alt="微信分享二维码">
</div>
<div class="mask"></div>
<ul class="article-footer-menu">
<li class="article-footer-tags">
<i class="fa fa-tags"></i>
<a href="/tags/bash/" class="color5">bash</a>
</li>
</ul>
</footer>
</div>
</article>
<aside class="post-toc-pos post-toc-top" id="post-toc">
<nav class="post-toc-wrap">
<ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#Bash功能"><span class="post-toc-text">Bash功能</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#指令操作"><span class="post-toc-text">指令操作</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#变量使用"><span class="post-toc-text">变量使用</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#相关命令"><span class="post-toc-text">相关命令</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#特殊符号"><span class="post-toc-text">特殊符号</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#数据流重导向"><span class="post-toc-text">数据流重导向</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#提取命令"><span class="post-toc-text">提取命令</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#排序命令"><span class="post-toc-text">排序命令</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#双向重导向"><span class="post-toc-text">双向重导向</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#字符转换"><span class="post-toc-text">字符转换</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#分区命令"><span class="post-toc-text">分区命令</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#参数替换"><span class="post-toc-text">参数替换</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#减号用途"><span class="post-toc-text">减号用途</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#重点回顾"><span class="post-toc-text">重点回顾</span></a></li></ol>
</nav>
</aside>
<nav id="article-nav">
<a href="/idea-2018.3-beat.html" id="article-nav-newer" class="article-nav-link-wrap">
<span class="article-nav-title">
<i class="fa fa-hand-o-left" aria-hidden="true"></i>
IntelliJ IDEA 2018.3 Beta 重大更新:支持 CPU 火焰图,新增酷炫主题
</span>
</a>
<a href="/linux-vi-and-vim.html" id="article-nav-older" class="article-nav-link-wrap">
<span class="article-nav-title">Linux 私房菜:vi 与 vim 编辑器</span>
<i class="fa fa-hand-o-right" aria-hidden="true"></i>
</a>
</nav>
<div id="SOHUCS" sid="Linux 私房菜:走进bash" ></div>
<script type="text/javascript">
(function(){
var appid = 'cytsi4W0L';
var conf = 'prod_302a63175740fd2ee2587f9345477b4c';
var width = window.innerWidth || document.documentElement.clientWidth;
if (width < 960) {
window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); } })(); </script>
</section>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info" class="inner">
<p>
<span id="busuanzi_container_site_uv" style='display:none'>
访客数:<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" style='display:none'>
访问量:<span id="busuanzi_value_site_pv"></span>
</span>
<span style='margin-left:5px'>
粤ICP备17033077号-1
</span>
</p>
<p>
<!-- Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> -->
<!-- Theme <a href="//github.com/wongminho/hexo-theme-miho" target="_blank">MiHo</a> -->
Copyright © 2018 - 2020 happyJared
<!-- Hosted by <a href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a> -->
<script type="text/javascript" src="//js.users.51.la/19683707.js"></script>
<!-- <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1274993267'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1274993267%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script> -->
<br>
</p>
</div>
</div>
</footer>
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script src="https://v1.hitokoto.cn/?encode=js&select=%23hitokoto" defer></script>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script>
var mihoConfig = {
root: "https://blog.mariojd.cn",
animate: false,
isHome: false,
share: true,
reward: 1
}
</script>
<div class="sidebar">
<div id="sidebar-search" title="Search">
<i class="fa fa-search"></i>
</div>
<div id="sidebar-category" title="Categories">
<i class="fa fa-book"></i>
</div>
<div id="sidebar-tag" title="Tags">
<i class="fa fa-tags"></i>
</div>
<div id="sidebar-top">
<span class="sidebar-top-icon"><i class="fa fa-angle-up"></i></span>
</div>
</div>
<div class="sidebar-menu-box" id="sidebar-menu-box">
<div class="sidebar-menu-box-container">
<div id="sidebar-menu-box-categories">
<a class="category-link" href="/categories/Chocolatey/">Chocolatey</a><a class="category-link" href="/categories/Docker/">Docker</a><a class="category-link" href="/categories/Docker/Elasticsearch/">Elasticsearch</a><a class="category-link" href="/categories/Docker/MySQL/">MySQL</a><a class="category-link" href="/categories/Docker/PostgreSQL/">PostgreSQL</a><a class="category-link" href="/categories/Docker/Redis/">Redis</a><a class="category-link" href="/categories/IDEA/">IDEA</a><a class="category-link" href="/categories/Java/">Java</a><a class="category-link" href="/categories/Java/Lombok/">Lombok</a><a class="category-link" href="/categories/Java/Spring-Boot/">Spring Boot</a><a class="category-link" href="/categories/Java/Spring-Boot/Swagger/">Swagger</a><a class="category-link" href="/categories/Java/热部署/">热部署</a><a class="category-link" href="/categories/Jmeter/">Jmeter</a><a class="category-link" href="/categories/Linux/">Linux</a><a class="category-link" href="/categories/Micro-Service/">Micro Service</a><a class="category-link" href="/categories/Python/">Python</a><a class="category-link" href="/categories/Python/Selenium/">Selenium</a><a class="category-link" href="/categories/Python/Selenium/Windows-Batch/">Windows Batch</a><a class="category-link" href="/categories/Redis/">Redis</a><a class="category-link" href="/categories/Spring/">Spring</a><a class="category-link" href="/categories/Web/">Web</a><a class="category-link" href="/categories/hexo/">hexo</a><a class="category-link" href="/categories/python/">python</a><a class="category-link" href="/categories/websocket/">websocket</a><a class="category-link" href="/categories/中间件/">中间件</a><a class="category-link" href="/categories/前端/">前端</a><a class="category-link" href="/categories/学习资源/">学习资源</a><a class="category-link" href="/categories/开源/">开源</a><a class="category-link" href="/categories/开源/YApi/">YApi</a><a class="category-link" href="/categories/开源/YApi/Swagger/">Swagger</a><a class="category-link" href="/categories/开源和中间件/">开源和中间件</a><a class="category-link" href="/categories/开源项目/">开源项目</a><a class="category-link" href="/categories/抓包工具/">抓包工具</a><a class="category-link" href="/categories/数据库中间件/">数据库中间件</a><a class="category-link" href="/categories/数据库中间件/Mycat/">Mycat</a><a class="category-link" href="/categories/编辑器/">编辑器</a><a class="category-link" href="/categories/编辑器/个人感悟/">个人感悟</a><a class="category-link" href="/categories/编辑器/快捷键/">快捷键</a><a class="category-link" href="/categories/设计模式/">设计模式</a><a class="category-link" href="/categories/随笔/">随笔</a>
</div>
<div id="sidebar-menu-box-tags">
<a href="/tags/AcpectJ/" style="font-size: 10px;">AcpectJ</a> <a href="/tags/Aop/" style="font-size: 10px;">Aop</a> <a href="/tags/Chocolatey/" style="font-size: 10px;">Chocolatey</a> <a href="/tags/Config-Center/" style="font-size: 10.91px;">Config Center</a> <a href="/tags/Ctrip-Apollo/" style="font-size: 10.91px;">Ctrip Apollo</a> <a href="/tags/Eclipse/" style="font-size: 10.91px;">Eclipse</a> <a href="/tags/Faker/" style="font-size: 10.91px;">Faker</a> <a href="/tags/Fiddler/" style="font-size: 10px;">Fiddler</a> <a href="/tags/GitHub-Pages/" style="font-size: 10.91px;">GitHub Pages</a> <a href="/tags/Hexo/" style="font-size: 10px;">Hexo</a> <a href="/tags/IDEA/" style="font-size: 20px;">IDEA</a> <a href="/tags/JSR-303/" style="font-size: 10px;">JSR 303</a> <a href="/tags/Java/" style="font-size: 16.36px;">Java</a> <a href="/tags/Java类库/" style="font-size: 10px;">Java类库</a> <a href="/tags/JetBrains/" style="font-size: 18.18px;">JetBrains</a> <a href="/tags/Jmeter/" style="font-size: 11.82px;">Jmeter</a> <a href="/tags/Lombok/" style="font-size: 10px;">Lombok</a> <a href="/tags/Micro-Service/" style="font-size: 10.91px;">Micro Service</a> <a href="/tags/Mycat/" style="font-size: 12.73px;">Mycat</a> <a href="/tags/ORM/" style="font-size: 10.91px;">ORM</a> <a href="/tags/Peewee/" style="font-size: 10px;">Peewee</a> <a href="/tags/Python/" style="font-size: 11.82px;">Python</a> <a href="/tags/RestTemplate/" style="font-size: 10px;">RestTemplate</a> <a href="/tags/SQLAlchemy/" style="font-size: 10px;">SQLAlchemy</a> <a href="/tags/Spring/" style="font-size: 10.91px;">Spring</a> <a href="/tags/Spring-Boot/" style="font-size: 13.64px;">Spring Boot</a> <a href="/tags/Spring-Data-Elasticsearch/" style="font-size: 10px;">Spring Data Elasticsearch</a> <a href="/tags/Spring-in-action/" style="font-size: 10px;">Spring in action</a> <a href="/tags/Windows/" style="font-size: 10px;">Windows</a> <a href="/tags/ajax/" style="font-size: 10px;">ajax</a> <a href="/tags/appium/" style="font-size: 10px;">appium</a> <a href="/tags/base-command/" style="font-size: 10px;">base command</a> <a href="/tags/bash/" style="font-size: 10px;">bash</a> <a href="/tags/bat/" style="font-size: 10px;">bat</a> <a href="/tags/bat脚本/" style="font-size: 10px;">bat脚本</a> <a href="/tags/beautifulsoup4/" style="font-size: 10px;">beautifulsoup4</a> <a href="/tags/boss/" style="font-size: 10px;">boss</a> <a href="/tags/builder/" style="font-size: 10px;">builder</a> <a href="/tags/chrome/" style="font-size: 10.91px;">chrome</a> <a href="/tags/chrome-plugin/" style="font-size: 10px;">chrome plugin</a> <a href="/tags/coding-net/" style="font-size: 10px;">coding.net</a> <a href="/tags/common-commands/" style="font-size: 10.91px;">common commands</a> <a href="/tags/csdn/" style="font-size: 10px;">csdn</a> <a href="/tags/design-patterns/" style="font-size: 14.55px;">design patterns</a> <a href="/tags/directory-management/" style="font-size: 10px;">directory management</a> <a href="/tags/directory-permission/" style="font-size: 10px;">directory permission</a> <a href="/tags/disk-management/" style="font-size: 10px;">disk management</a> <a href="/tags/docker/" style="font-size: 15.45px;">docker</a> <a href="/tags/docker-compose/" style="font-size: 10px;">docker compose</a> <a href="/tags/druid/" style="font-size: 10px;">druid</a> <a href="/tags/elasticsearch/" style="font-size: 10.91px;">elasticsearch</a> <a href="/tags/elasticsearch-cluster/" style="font-size: 10px;">elasticsearch cluster</a> <a href="/tags/ffmpeg/" style="font-size: 10px;">ffmpeg</a> <a href="/tags/fiddler/" style="font-size: 10px;">fiddler</a> <a href="/tags/fiddler-capture/" style="font-size: 10px;">fiddler capture</a> <a href="/tags/file-management/" style="font-size: 10px;">file management</a> <a href="/tags/file-permission/" style="font-size: 10px;">file permission</a> <a href="/tags/head-plugin/" style="font-size: 10px;">head plugin</a> <a href="/tags/hexo/" style="font-size: 13.64px;">hexo</a> <a href="/tags/hexo-themes/" style="font-size: 10px;">hexo themes</a> <a href="/tags/hexo-translate-title/" style="font-size: 10px;">hexo-translate-title</a> <a href="/tags/hot-key/" style="font-size: 10px;">hot key</a> <a href="/tags/http/" style="font-size: 10px;">http</a> <a href="/tags/http-proxy/" style="font-size: 10px;">http proxy</a> <a href="/tags/http-s/" style="font-size: 10px;">http(s)</a> <a href="/tags/https/" style="font-size: 10px;">https</a> <a href="/tags/https抓包/" style="font-size: 10px;">https抓包</a> <a href="/tags/ik-analysis/" style="font-size: 10px;">ik analysis</a> <a href="/tags/imooc/" style="font-size: 10px;">imooc</a> <a href="/tags/itchat/" style="font-size: 10px;">itchat</a> <a href="/tags/jasypt-spring-boot/" style="font-size: 10px;">jasypt spring boot</a> <a href="/tags/java/" style="font-size: 10.91px;">java</a> <a href="/tags/java-error/" style="font-size: 10px;">java error</a> <a href="/tags/java-exception/" style="font-size: 10px;">java exception</a> <a href="/tags/java8-stream/" style="font-size: 10px;">java8 stream</a> <a href="/tags/javacv/" style="font-size: 10px;">javacv</a> <a href="/tags/jetcache/" style="font-size: 10px;">jetcache</a> <a href="/tags/jsonp/" style="font-size: 10px;">jsonp</a> <a href="/tags/jvm/" style="font-size: 10px;">jvm</a> <a href="/tags/lagou/" style="font-size: 10px;">lagou</a> <a href="/tags/linux-backup/" style="font-size: 10px;">linux backup</a> <a href="/tags/linux-compress/" style="font-size: 10px;">linux compress</a> <a href="/tags/linux-packeage/" style="font-size: 10px;">linux packeage</a> <a href="/tags/linux-thing/" style="font-size: 13.64px;">linux thing</a> <a href="/tags/mind-mapping/" style="font-size: 11.82px;">mind mapping</a> <a href="/tags/mitmproxy/" style="font-size: 10px;">mitmproxy</a> <a href="/tags/mongo-express/" style="font-size: 10px;">mongo-express</a> <a href="/tags/mongodb/" style="font-size: 10px;">mongodb</a> <a href="/tags/multiple-datasource/" style="font-size: 10.91px;">multiple datasource</a> <a href="/tags/mybatis/" style="font-size: 10px;">mybatis</a> <a href="/tags/mysql/" style="font-size: 11.82px;">mysql</a> <a href="/tags/nginx/" style="font-size: 10.91px;">nginx</a> <a href="/tags/oschina/" style="font-size: 10px;">oschina</a> <a href="/tags/postgresql/" style="font-size: 11.82px;">postgresql</a> <a href="/tags/prototype/" style="font-size: 10px;">prototype</a> <a href="/tags/py2exe/" style="font-size: 10px;">py2exe</a> <a href="/tags/pyinstaller/" style="font-size: 10px;">pyinstaller</a> <a href="/tags/python/" style="font-size: 17.27px;">python</a> <a href="/tags/python-core/" style="font-size: 10px;">python core</a> <a href="/tags/python-data-science/" style="font-size: 10px;">python data science</a> <a href="/tags/python-spider/" style="font-size: 10px;">python spider</a> <a href="/tags/python-standard-library/" style="font-size: 10px;">python standard library</a> <a href="/tags/redis/" style="font-size: 12.73px;">redis</a> <a href="/tags/redis-sentinel/" style="font-size: 10px;">redis-sentinel</a> <a href="/tags/requests/" style="font-size: 10px;">requests</a> <a href="/tags/restful-api/" style="font-size: 10px;">restful api</a> <a href="/tags/scrapy/" style="font-size: 12.73px;">scrapy</a> <a href="/tags/selenium/" style="font-size: 13.64px;">selenium</a> <a href="/tags/shortcuts-key/" style="font-size: 10px;">shortcuts key</a> <a href="/tags/simple-factory/" style="font-size: 11.82px;">simple factory</a> <a href="/tags/singleton/" style="font-size: 10px;">singleton</a> <a href="/tags/spider/" style="font-size: 10.91px;">spider</a> <a href="/tags/spider-crawl/" style="font-size: 10px;">spider crawl</a> <a href="/tags/spring-boot/" style="font-size: 17.27px;">spring boot</a> <a href="/tags/spring-boot-actuator/" style="font-size: 10px;">spring boot actuator</a> <a href="/tags/spring-boot-admin/" style="font-size: 10px;">spring boot admin</a> <a href="/tags/spring-boot2/" style="font-size: 10px;">spring boot2</a> <a href="/tags/spring-cache/" style="font-size: 10px;">spring cache</a> <a href="/tags/spring-data-jpa/" style="font-size: 12.73px;">spring data jpa</a> <a href="/tags/spring-data-rest/" style="font-size: 10px;">spring data rest</a> <a href="/tags/swagger/" style="font-size: 10.91px;">swagger</a> <a href="/tags/tomcat/" style="font-size: 10px;">tomcat</a> <a href="/tags/vi/" style="font-size: 10px;">vi</a> <a href="/tags/vim/" style="font-size: 10px;">vim</a> <a href="/tags/vimium/" style="font-size: 10px;">vimium</a> <a href="/tags/websocket/" style="font-size: 10px;">websocket</a> <a href="/tags/weixin/" style="font-size: 10px;">weixin</a> <a href="/tags/ws-s/" style="font-size: 10px;">ws(s)</a> <a href="/tags/wss/" style="font-size: 10px;">wss</a> <a href="/tags/yapi/" style="font-size: 10px;">yapi</a> <a href="/tags/zealer/" style="font-size: 10px;">zealer</a> <a href="/tags/个人博客/" style="font-size: 10.91px;">个人博客</a> <a href="/tags/个人感悟/" style="font-size: 10.91px;">个人感悟</a> <a href="/tags/主从复制/" style="font-size: 10.91px;">主从复制</a> <a href="/tags/主从搭建/" style="font-size: 11.82px;">主从搭建</a> <a href="/tags/乐观锁/" style="font-size: 10px;">乐观锁</a> <a href="/tags/代理调试/" style="font-size: 10px;">代理调试</a> <a href="/tags/入门篇/" style="font-size: 10px;">入门篇</a> <a href="/tags/单例/" style="font-size: 10px;">单例</a> <a href="/tags/博客/" style="font-size: 10px;">博客</a> <a href="/tags/压测工具/" style="font-size: 11.82px;">压测工具</a> <a href="/tags/原型/" style="font-size: 10px;">原型</a> <a href="/tags/字符串机制/" style="font-size: 10px;">字符串机制</a> <a href="/tags/学习资源/" style="font-size: 10.91px;">学习资源</a> <a href="/tags/实践篇/" style="font-size: 10.91px;">实践篇</a> <a href="/tags/工厂方法/" style="font-size: 10px;">工厂方法</a> <a href="/tags/建造者/" style="font-size: 10px;">建造者</a> <a href="/tags/开源/" style="font-size: 10px;">开源</a> <a href="/tags/开源博客/" style="font-size: 10.91px;">开源博客</a> <a href="/tags/开源项目/" style="font-size: 10.91px;">开源项目</a> <a href="/tags/微信授权/" style="font-size: 10px;">微信授权</a> <a href="/tags/悲观锁/" style="font-size: 10px;">悲观锁</a> <a href="/tags/抽象工厂/" style="font-size: 10px;">抽象工厂</a> <a href="/tags/数据库中间件/" style="font-size: 12.73px;">数据库中间件</a> <a href="/tags/热部署/" style="font-size: 10px;">热部署</a> <a href="/tags/简书/" style="font-size: 10px;">简书</a> <a href="/tags/简单工厂/" style="font-size: 10px;">简单工厂</a> <a href="/tags/编辑器/" style="font-size: 19.09px;">编辑器</a> <a href="/tags/读书笔记/" style="font-size: 10px;">读书笔记</a> <a href="/tags/读写分离/" style="font-size: 10.91px;">读写分离</a> <a href="/tags/跑步/" style="font-size: 10px;">跑步</a> <a href="/tags/配置篇/" style="font-size: 10px;">配置篇</a> <a href="/tags/钉钉运动/" style="font-size: 10px;">钉钉运动</a> <a href="/tags/阿里技术/" style="font-size: 10px;">阿里技术</a>
</div>
</div>
<a href="javascript:;" class="sidebar-menu-box-close">×</a>
</div>
<div class="mobile-header-menu-nav" id="mobile-header-menu-nav">
<div class="mobile-header-menu-container">
<span class="title">Menus</span>
<ul class="mobile-header-menu-navbar">
<li>
<a href="/">
<i class="fa fa-h-square"></i><span>主页</span>
</a>
</li>
<li>
<a href="/life">
<i class="fa fa-battery-three-quarters"></i><span>岁月</span>
</a>
</li>
<li>
<a target="_blank" href="https://mp.mariojd.cn">
<i class="fa fa-dot-circle-o"></i><span>洞见</span>
</a>
</li>
<li>
<a href="/archives">
<i class="fa fa-window-restore"></i><span>归档</span>
</a>
</li>
<li>
<a target="_blank" href="http://jianshu.mariojd.cn">
<i class="fa fa-superpowers"></i><span>简统</span>
</a>
</li>
<li>
<a href="/about">
<i class="fa fa-user"></i><span>关于</span>
</a>
</li>
</ul>
</div>
<div class="mobile-header-tag-container">
<span class="title">Tags</span>
<div id="mobile-header-container-tags">
<a href="/tags/AcpectJ/" style="font-size: 10px;">AcpectJ</a> <a href="/tags/Aop/" style="font-size: 10px;">Aop</a> <a href="/tags/Chocolatey/" style="font-size: 10px;">Chocolatey</a> <a href="/tags/Config-Center/" style="font-size: 10.91px;">Config Center</a> <a href="/tags/Ctrip-Apollo/" style="font-size: 10.91px;">Ctrip Apollo</a> <a href="/tags/Eclipse/" style="font-size: 10.91px;">Eclipse</a> <a href="/tags/Faker/" style="font-size: 10.91px;">Faker</a> <a href="/tags/Fiddler/" style="font-size: 10px;">Fiddler</a> <a href="/tags/GitHub-Pages/" style="font-size: 10.91px;">GitHub Pages</a> <a href="/tags/Hexo/" style="font-size: 10px;">Hexo</a> <a href="/tags/IDEA/" style="font-size: 20px;">IDEA</a> <a href="/tags/JSR-303/" style="font-size: 10px;">JSR 303</a> <a href="/tags/Java/" style="font-size: 16.36px;">Java</a> <a href="/tags/Java类库/" style="font-size: 10px;">Java类库</a> <a href="/tags/JetBrains/" style="font-size: 18.18px;">JetBrains</a> <a href="/tags/Jmeter/" style="font-size: 11.82px;">Jmeter</a> <a href="/tags/Lombok/" style="font-size: 10px;">Lombok</a> <a href="/tags/Micro-Service/" style="font-size: 10.91px;">Micro Service</a> <a href="/tags/Mycat/" style="font-size: 12.73px;">Mycat</a> <a href="/tags/ORM/" style="font-size: 10.91px;">ORM</a> <a href="/tags/Peewee/" style="font-size: 10px;">Peewee</a> <a href="/tags/Python/" style="font-size: 11.82px;">Python</a> <a href="/tags/RestTemplate/" style="font-size: 10px;">RestTemplate</a> <a href="/tags/SQLAlchemy/" style="font-size: 10px;">SQLAlchemy</a> <a href="/tags/Spring/" style="font-size: 10.91px;">Spring</a> <a href="/tags/Spring-Boot/" style="font-size: 13.64px;">Spring Boot</a> <a href="/tags/Spring-Data-Elasticsearch/" style="font-size: 10px;">Spring Data Elasticsearch</a> <a href="/tags/Spring-in-action/" style="font-size: 10px;">Spring in action</a> <a href="/tags/Windows/" style="font-size: 10px;">Windows</a> <a href="/tags/ajax/" style="font-size: 10px;">ajax</a> <a href="/tags/appium/" style="font-size: 10px;">appium</a> <a href="/tags/base-command/" style="font-size: 10px;">base command</a> <a href="/tags/bash/" style="font-size: 10px;">bash</a> <a href="/tags/bat/" style="font-size: 10px;">bat</a> <a href="/tags/bat脚本/" style="font-size: 10px;">bat脚本</a> <a href="/tags/beautifulsoup4/" style="font-size: 10px;">beautifulsoup4</a> <a href="/tags/boss/" style="font-size: 10px;">boss</a> <a href="/tags/builder/" style="font-size: 10px;">builder</a> <a href="/tags/chrome/" style="font-size: 10.91px;">chrome</a> <a href="/tags/chrome-plugin/" style="font-size: 10px;">chrome plugin</a> <a href="/tags/coding-net/" style="font-size: 10px;">coding.net</a> <a href="/tags/common-commands/" style="font-size: 10.91px;">common commands</a> <a href="/tags/csdn/" style="font-size: 10px;">csdn</a> <a href="/tags/design-patterns/" style="font-size: 14.55px;">design patterns</a> <a href="/tags/directory-management/" style="font-size: 10px;">directory management</a> <a href="/tags/directory-permission/" style="font-size: 10px;">directory permission</a> <a href="/tags/disk-management/" style="font-size: 10px;">disk management</a> <a href="/tags/docker/" style="font-size: 15.45px;">docker</a> <a href="/tags/docker-compose/" style="font-size: 10px;">docker compose</a> <a href="/tags/druid/" style="font-size: 10px;">druid</a> <a href="/tags/elasticsearch/" style="font-size: 10.91px;">elasticsearch</a> <a href="/tags/elasticsearch-cluster/" style="font-size: 10px;">elasticsearch cluster</a> <a href="/tags/ffmpeg/" style="font-size: 10px;">ffmpeg</a> <a href="/tags/fiddler/" style="font-size: 10px;">fiddler</a> <a href="/tags/fiddler-capture/" style="font-size: 10px;">fiddler capture</a> <a href="/tags/file-management/" style="font-size: 10px;">file management</a> <a href="/tags/file-permission/" style="font-size: 10px;">file permission</a> <a href="/tags/head-plugin/" style="font-size: 10px;">head plugin</a> <a href="/tags/hexo/" style="font-size: 13.64px;">hexo</a> <a href="/tags/hexo-themes/" style="font-size: 10px;">hexo themes</a> <a href="/tags/hexo-translate-title/" style="font-size: 10px;">hexo-translate-title</a> <a href="/tags/hot-key/" style="font-size: 10px;">hot key</a> <a href="/tags/http/" style="font-size: 10px;">http</a> <a href="/tags/http-proxy/" style="font-size: 10px;">http proxy</a> <a href="/tags/http-s/" style="font-size: 10px;">http(s)</a> <a href="/tags/https/" style="font-size: 10px;">https</a> <a href="/tags/https抓包/" style="font-size: 10px;">https抓包</a> <a href="/tags/ik-analysis/" style="font-size: 10px;">ik analysis</a> <a href="/tags/imooc/" style="font-size: 10px;">imooc</a> <a href="/tags/itchat/" style="font-size: 10px;">itchat</a> <a href="/tags/jasypt-spring-boot/" style="font-size: 10px;">jasypt spring boot</a> <a href="/tags/java/" style="font-size: 10.91px;">java</a> <a href="/tags/java-error/" style="font-size: 10px;">java error</a> <a href="/tags/java-exception/" style="font-size: 10px;">java exception</a> <a href="/tags/java8-stream/" style="font-size: 10px;">java8 stream</a> <a href="/tags/javacv/" style="font-size: 10px;">javacv</a> <a href="/tags/jetcache/" style="font-size: 10px;">jetcache</a> <a href="/tags/jsonp/" style="font-size: 10px;">jsonp</a> <a href="/tags/jvm/" style="font-size: 10px;">jvm</a> <a href="/tags/lagou/" style="font-size: 10px;">lagou</a> <a href="/tags/linux-backup/" style="font-size: 10px;">linux backup</a> <a href="/tags/linux-compress/" style="font-size: 10px;">linux compress</a> <a href="/tags/linux-packeage/" style="font-size: 10px;">linux packeage</a> <a href="/tags/linux-thing/" style="font-size: 13.64px;">linux thing</a> <a href="/tags/mind-mapping/" style="font-size: 11.82px;">mind mapping</a> <a href="/tags/mitmproxy/" style="font-size: 10px;">mitmproxy</a> <a href="/tags/mongo-express/" style="font-size: 10px;">mongo-express</a> <a href="/tags/mongodb/" style="font-size: 10px;">mongodb</a> <a href="/tags/multiple-datasource/" style="font-size: 10.91px;">multiple datasource</a> <a href="/tags/mybatis/" style="font-size: 10px;">mybatis</a> <a href="/tags/mysql/" style="font-size: 11.82px;">mysql</a> <a href="/tags/nginx/" style="font-size: 10.91px;">nginx</a> <a href="/tags/oschina/" style="font-size: 10px;">oschina</a> <a href="/tags/postgresql/" style="font-size: 11.82px;">postgresql</a> <a href="/tags/prototype/" style="font-size: 10px;">prototype</a> <a href="/tags/py2exe/" style="font-size: 10px;">py2exe</a> <a href="/tags/pyinstaller/" style="font-size: 10px;">pyinstaller</a> <a href="/tags/python/" style="font-size: 17.27px;">python</a> <a href="/tags/python-core/" style="font-size: 10px;">python core</a> <a href="/tags/python-data-science/" style="font-size: 10px;">python data science</a> <a href="/tags/python-spider/" style="font-size: 10px;">python spider</a> <a href="/tags/python-standard-library/" style="font-size: 10px;">python standard library</a> <a href="/tags/redis/" style="font-size: 12.73px;">redis</a> <a href="/tags/redis-sentinel/" style="font-size: 10px;">redis-sentinel</a> <a href="/tags/requests/" style="font-size: 10px;">requests</a> <a href="/tags/restful-api/" style="font-size: 10px;">restful api</a> <a href="/tags/scrapy/" style="font-size: 12.73px;">scrapy</a> <a href="/tags/selenium/" style="font-size: 13.64px;">selenium</a> <a href="/tags/shortcuts-key/" style="font-size: 10px;">shortcuts key</a> <a href="/tags/simple-factory/" style="font-size: 11.82px;">simple factory</a> <a href="/tags/singleton/" style="font-size: 10px;">singleton</a> <a href="/tags/spider/" style="font-size: 10.91px;">spider</a> <a href="/tags/spider-crawl/" style="font-size: 10px;">spider crawl</a> <a href="/tags/spring-boot/" style="font-size: 17.27px;">spring boot</a> <a href="/tags/spring-boot-actuator/" style="font-size: 10px;">spring boot actuator</a> <a href="/tags/spring-boot-admin/" style="font-size: 10px;">spring boot admin</a> <a href="/tags/spring-boot2/" style="font-size: 10px;">spring boot2</a> <a href="/tags/spring-cache/" style="font-size: 10px;">spring cache</a> <a href="/tags/spring-data-jpa/" style="font-size: 12.73px;">spring data jpa</a> <a href="/tags/spring-data-rest/" style="font-size: 10px;">spring data rest</a> <a href="/tags/swagger/" style="font-size: 10.91px;">swagger</a> <a href="/tags/tomcat/" style="font-size: 10px;">tomcat</a> <a href="/tags/vi/" style="font-size: 10px;">vi</a> <a href="/tags/vim/" style="font-size: 10px;">vim</a> <a href="/tags/vimium/" style="font-size: 10px;">vimium</a> <a href="/tags/websocket/" style="font-size: 10px;">websocket</a> <a href="/tags/weixin/" style="font-size: 10px;">weixin</a> <a href="/tags/ws-s/" style="font-size: 10px;">ws(s)</a> <a href="/tags/wss/" style="font-size: 10px;">wss</a> <a href="/tags/yapi/" style="font-size: 10px;">yapi</a> <a href="/tags/zealer/" style="font-size: 10px;">zealer</a> <a href="/tags/个人博客/" style="font-size: 10.91px;">个人博客</a> <a href="/tags/个人感悟/" style="font-size: 10.91px;">个人感悟</a> <a href="/tags/主从复制/" style="font-size: 10.91px;">主从复制</a> <a href="/tags/主从搭建/" style="font-size: 11.82px;">主从搭建</a> <a href="/tags/乐观锁/" style="font-size: 10px;">乐观锁</a> <a href="/tags/代理调试/" style="font-size: 10px;">代理调试</a> <a href="/tags/入门篇/" style="font-size: 10px;">入门篇</a> <a href="/tags/单例/" style="font-size: 10px;">单例</a> <a href="/tags/博客/" style="font-size: 10px;">博客</a> <a href="/tags/压测工具/" style="font-size: 11.82px;">压测工具</a> <a href="/tags/原型/" style="font-size: 10px;">原型</a> <a href="/tags/字符串机制/" style="font-size: 10px;">字符串机制</a> <a href="/tags/学习资源/" style="font-size: 10.91px;">学习资源</a> <a href="/tags/实践篇/" style="font-size: 10.91px;">实践篇</a> <a href="/tags/工厂方法/" style="font-size: 10px;">工厂方法</a> <a href="/tags/建造者/" style="font-size: 10px;">建造者</a> <a href="/tags/开源/" style="font-size: 10px;">开源</a> <a href="/tags/开源博客/" style="font-size: 10.91px;">开源博客</a> <a href="/tags/开源项目/" style="font-size: 10.91px;">开源项目</a> <a href="/tags/微信授权/" style="font-size: 10px;">微信授权</a> <a href="/tags/悲观锁/" style="font-size: 10px;">悲观锁</a> <a href="/tags/抽象工厂/" style="font-size: 10px;">抽象工厂</a> <a href="/tags/数据库中间件/" style="font-size: 12.73px;">数据库中间件</a> <a href="/tags/热部署/" style="font-size: 10px;">热部署</a> <a href="/tags/简书/" style="font-size: 10px;">简书</a> <a href="/tags/简单工厂/" style="font-size: 10px;">简单工厂</a> <a href="/tags/编辑器/" style="font-size: 19.09px;">编辑器</a> <a href="/tags/读书笔记/" style="font-size: 10px;">读书笔记</a> <a href="/tags/读写分离/" style="font-size: 10.91px;">读写分离</a> <a href="/tags/跑步/" style="font-size: 10px;">跑步</a> <a href="/tags/配置篇/" style="font-size: 10px;">配置篇</a> <a href="/tags/钉钉运动/" style="font-size: 10px;">钉钉运动</a> <a href="/tags/阿里技术/" style="font-size: 10px;">阿里技术</a>
</div>
</div>
</div>
<div class="search-wrap">
<span class="search-close">×</span>
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
<i class="icon icon-lg icon-chevron-left"></i>
</a>
<input class="search-field" placeholder="Search..." id="keywords">
<a id="search-submit" href="javascript:;">
<i class="fa fa-search"></i>
</a>
<div class="search-container" id="search-container">
<ul class="search-result" id="search-result">
</ul>
</div>
</div>
<div id="search-tpl">
<li class="search-result-item">
<a href="{url}" class="search-item-li">
<span class="search-item-li-title" title="{title}">{title}</span>
</a>
</li>
</div>
<script src="/js/search.js"></script>
<script src="/js/main.js"></script>
<script src="//cdn.bootcss.com/particles.js/2.0.0/particles.min.js"></script>
<div id="particles"></div>
<script src="/js/particles.js"></script>
<script src="/js/pop-img.js"></script>
<script>
$(".article-entry p img").popImg();
</script>
</div>
</body>
</html>