forked from netkiller/netkiller.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.html
More file actions
552 lines (448 loc) · 20.4 KB
/
text.html
File metadata and controls
552 lines (448 loc) · 20.4 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>5.8. Text Processing</title><link rel="stylesheet" type="text/css" href="..//docbook.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><meta name="keywords" content="shell,bash,zsh, awk,sed,curl,expect, grep,sort" /><link rel="home" href="../index.html" title="Netkiller Shell 手札" /><link rel="up" href="index.html" title="第 5 章 Shell command" /><link rel="prev" href="numeric.html" title="5.7. Numeric" /><link rel="next" href="grep.html" title="5.9. grep, egrep, fgrep, rgrep - print lines matching a pattern" /></head><body><a xmlns="" href="//www.netkiller.cn/">Home</a> |
<a xmlns="" href="//netkiller.github.io/">简体中文</a> |
<a xmlns="" href="http://netkiller.sourceforge.net/">繁体中文</a> |
<a xmlns="" href="/journal/index.html">杂文</a> |
<a xmlns="" href="//www.netkiller.cn/home/donations.html">打赏(Donations)</a> |
<a xmlns="" href="https://github.com/netkiller">Github</a> |
<a xmlns="" href="http://my.oschina.net/neochen/">OSChina 博客</a> |
<a xmlns="" href="https://cloud.tencent.com/developer/column/2078">云社区</a> |
<a xmlns="" href="https://yq.aliyun.com/u/netkiller/">云栖社区</a> |
<a xmlns="" href="https://www.facebook.com/bg7nyt">Facebook</a> |
<a xmlns="" href="http://cn.linkedin.com/in/netkiller/">Linkedin</a> |
<a xmlns="" href="https://zhuanlan.zhihu.com/netkiller">知乎专栏</a> |
<a xmlns="" href="//www.netkiller.cn/home/video.html">视频教程</a> |
<a xmlns="" href="//www.netkiller.cn/home/about.html">About</a><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.8. Text Processing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numeric.html">上一页</a> </td><th width="60%" align="center">第 5 章 Shell command</th><td width="20%" align="right"> <a accesskey="n" href="grep.html">下一页</a></td></tr></table><hr /></div><table xmlns=""><tr><td><iframe src="//ghbtns.com/github-btn.html?user=netkiller&repo=netkiller.github.io&type=watch&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe></td><td><iframe src="//ghbtns.com/github-btn.html?user=netkiller&repo=netkiller.github.io&type=fork&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe></td><td><iframe src="//ghbtns.com/github-btn.html?user=netkiller&type=follow&count=true&size=large" height="30" width="240" frameborder="0" scrolling="0" style="width:240px; height: 30px;" allowTransparency="true"></iframe></td></tr></table><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="text"></a>5.8. Text Processing</h2></div></div></div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="iconv"></a>5.8.1. iconv - Convert encoding of given files from one encoding to another</h3></div></div></div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp77"></a>5.8.1.1. cconv - A iconv based simplified-traditional chinese conversion tool</h4></div></div></div>
<p>cconv是建立在iconv之上,可以UTF8编码直接转换,并增加了词转换。</p>
<pre class="screen">
sudo apt-get install cconv
</pre>
<p>使用cconv进行简繁转换的方法为:</p>
<pre class="screen">
cconv -f UTF8-CN -t UTF8-HK zh-cn.txt -o zh-hk.txt
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp78"></a>5.8.1.2. uconv - convert data from one encoding to another</h4></div></div></div>
<p>安装</p>
<pre class="screen">
sudo apt-get install libicu-dev
</pre>
<p>例子</p>
<pre class="screen">
$ uconv -f cp1252 -t UTF-8 -o file_in_utf8.txt file_in_cp1252_encoding.txt
</pre>
</div>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="expr"></a>5.8.2. 字符串处理命令expr</h3></div></div></div>
<pre class="screen">
字符串处理命令expr用法简介:
名称:expr
用途:求表达式变量的值。
语法: expr Expression
实例如下:
例子1:字串长度
shell>> expr length "this is a test content";
22
例子2:求余数
shell>> expr 20 % 9
2
例子3:从指定位置处截取字符串
shell>> expr substr "this is a test content" 3 5
is is
例子4:指定字符串第一次出现的位置
shell>> expr index "testforthegame" s
3
例子5:字符串真实重现
shell>> expr quote thisisatestformela
thisisatestformela
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="cat"></a>5.8.3. cat - concatenate files and print on the standard output</h3></div></div></div>
<pre class="screen">
-b 不对空白行编号。
-e 使用 $ 字符显示行尾。
-n 从 1 开始对所有输出行编号。
-q 使用静默操作(禁止错误消息)。
-r 将所有多个空行替换为单行(“压缩”空白)。
-t 将制表符显示为 ^I。
-u 不对输出进行缓冲。
-v 可视地显示非打印控制字符。
</pre>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp79"></a>5.8.3.1. -s, --squeeze-blank suppress repeated empty output lines</h4></div></div></div>
<p>-S 将多个空白行压缩到单行中(与 -r 相同)</p>
<pre class="screen">
$ cat >> /tmp/test <<EOF
Line1
Line2
Line3
Line4
Line5
EOF
$ cat -s /tmp/test
Line1
Line2
Line3
Line4
Line5
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp80"></a>5.8.3.2. -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB</h4></div></div></div>
<p>显示控制字符。例如Tab等,下面例子查看文件结尾换行符类型</p>
<pre class="screen">
[neo@netkiller ~]# cat -v file.txt
GRANT USAGE ON *.* TO 'esauser'@'localhost' IDENTIFIED BY xxxxxxx; ^M
^M
file^M
2059^M
</pre>
</div>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="nl"></a>5.8.4. nl - number lines of files</h3></div></div></div>
<pre class="screen">
$ nl /etc/issue
1 CentOS release 5.4 (Final)
2 Kernel \r on an \m
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="tr"></a>5.8.5. tr - translate or delete characters</h3></div></div></div>
<pre class="screen">
[:alnum:] :所有字母字符与数字
[:alpha:] :所有字母字符
[:blank:] :所有水平空格
[:cntrl:] :所有控制字符
[:digit:] :所有数字
[:graph:] :所有可打印的字符(不包含空格符)
[:lower:] :所有小写字母
[:print:] :所有可打印的字符(包含空格符)
[:punct:] :所有标点字符
[:space:] :所有水平与垂直空格符
[:upper:] :所有大写字母
[:xdigit:] :所有 16 进位制的数字
</pre>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp81"></a>5.8.5.1. 替换字符</h4></div></div></div>
<p>":"替换为"\n"</p>
<pre class="screen">
$ cat /etc/passwd |tr ":" "\n"
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp82"></a>5.8.5.2. 英文大小写转换</h4></div></div></div>
<p>使用 tr '[:lower:]' '[:upper:]' 将小写字母替换成大写字母</p>
<pre class="screen">
[root@localhost ~]# echo "Helloworld" | tr '[:lower:]' '[:upper:]'
HELLOWORLD
</pre>
<p>替换整段文字</p>
<pre class="screen">
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]# cat /etc/redhat-release | tr '[:lower:]' '[:upper:]'
CENTOS LINUX RELEASE 7.5.1804 (CORE)
</pre>
<p></p>
<pre class="screen">
[root@localhost ~]# echo "Netkiller" | tr ‘a-z’ ‘A-Z’
NETKILLER
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp83"></a>5.8.5.3. [CHAR*] 和 [CHAR*REPEAT]</h4></div></div></div>
<p></p>
<pre class="screen">
[root@localhost ~]# echo "1234567890" | tr ‘1-5′ ‘[A*]‘
AAAAA67890
[root@localhost ~]# echo "1234567890" | tr ‘1-9′ ‘[A*5]BCDE’
AAAAABCDE0
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="tr.squeeze"></a>5.8.5.4. -s, --squeeze-repeats replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character</h4></div></div></div>
<p>删除重复的字符</p>
<pre class="screen">
[root@localhost ~]# echo "My nickname is netkiller." | tr -s ' '
My nickname is netkiller.
[root@localhost ~]# echo "aaaabbbbccccdddd." | tr -s 'a'
abbbbccccdddd.
[root@localhost ~]# echo "aaaabbbbccccdddd." | tr -s 'a-z'
abcd.
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="tr.delete"></a>5.8.5.5. -d, --delete
delete characters in SET1, do not translate</h4></div></div></div>
<p>删除字符</p>
<pre class="screen">
[root@localhost ~]# echo "My nickname is netkiller" | tr -d ' '
Mynicknameisnetkiller
[root@localhost ~]# md5sum /etc/issue | tr -d [0-9]
ffedfcfbdcaebdec /etc/issue
</pre>
</div>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="cut"></a>5.8.6. cut - remove sections from each line of files</h3></div></div></div>
<p>列操作</p>
<pre class="screen">
$ last | grep 'neo' | cut -d ' ' -f1
</pre>
<pre class="screen">
$ cat /etc/passwd | cut -d ':' -f1
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
proxy
$ cat /etc/passwd | cut -d ':' -f1,3,4
# cat /etc/passwd | cut -d ':' -f1,6
root:/root
bin:/bin
daemon:/sbin
adm:/var/adm
lp:/var/spool/lpd
sync:/sbin
shutdown:/sbin
halt:/sbin
mail:/var/spool/mail
uucp:/var/spool/uucp
operator:/root
games:/usr/games
gopher:/var/gopher
ftp:/var/ftp
nobody:/
vcsa:/dev
saslauth:/var/empty/saslauth
postfix:/var/spool/postfix
sshd:/var/empty/sshd
rpc:/var/cache/rpcbind
rpcuser:/var/lib/nfs
nfsnobody:/var/lib/nfs
ntp:/etc/ntp
nagios:/var/log/nagios
</pre>
<p>行操作</p>
<pre class="screen">
$ cat /etc/passwd | cut -c 1-4
root
daem
bin:
sys:
sync
game
man:
$ echo "No such file or directory"| cut -c4-7
such
$ echo "No such file or directory"| cut -c -8
No such
$ echo "No such file or directory"| cut -c-8
No such
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="printf"></a>5.8.7. printf - format and print data</h3></div></div></div>
<pre class="screen">
printf "%d\n" 1234
</pre>
<pre class="screen">
$ printf "\033[1;33m TEST COLOR \n\033[m"
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="recode"></a>5.8.8. Free `recode' converts files between various character sets and surfaces.</h3></div></div></div>
<p>Following will convert text files between DOS, Mac, and Unix line ending styles:</p>
<pre class="screen">
$ recode /cl../cr <dos.txt >mac.txt
$ recode /cr.. <mac.txt >unix.txt
$ recode ../cl <unix.txt >dos.txt
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="urandom"></a>5.8.9. /dev/urandom 随机字符串</h3></div></div></div>
<pre class="screen">
[neo@test .deploy]$ echo `< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c 8`
GidAuuNN
[neo@test .deploy]$ echo `< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c 8`
UyGaWSKr
</pre>
<p>我常常使用这样的随机字符初始化密码</p>
<pre class="screen">
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:alnum:] | head -c 8`
xig8Meym
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:alnum:] | head -c 8`
23Ac1vZg
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:digit:] | head -c 8`
73652314
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:graph:] | head -c 8`
GO_o>OnJ
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:graph:] | head -c 10`
iGy0FS/aO5
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:graph:] | head -c 50`
;`E^{5(T4v~5$YovW.?%_?9la<`+qPcRh@7mD\!Whx;MJZVQ\K
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:print:] | head -c 50`
fy$[#:'(')jt'gp1/g-)d~p]8 :r9i;MO2d!8M<?Qs3t:QgK$O
[neo@test .deploy]$ echo `< /dev/urandom tr -dc [:graph:] | head -c 50`
6SivJ5y$/FTi8mf}rrqE&s0"WkA}r;uK-=MT!Wp0UlL_lF0|bL
</pre>
<p>批量生成</p>
<pre class="screen">
for i in {1..10}
do
echo `< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c 8`
done
</pre>
<pre class="screen">
# cat /dev/urandom | tr -cd [:alnum:] | fold -w30 | head -n 20
AVqROzjF6ZATJGv2J6PzDHp3jLpKV4
ONt68UFNDwgXpSnLBV7oRDX3VLRYsX
EZTWCGvZc3mIEeuw9sxMtV8ZkzVRJv
BhUiv0a7utsjZFLYpKGZrY5aDXcZL4
5YfUl2hmDT1O9X61DRYg4wSp4lXoXX
ykyPJxH47PzxnNGlujIUF98ZtB01H0
QyP53mksQN8bCNNo1fSD3RtqhhEGfa
u2RkT1M9GUQF4a6O18tG5WD97OOXze
Whm5X7398Q8L9BONN8k2oLy9CL37JO
TmGQz7WB6WnkjhyB4wrBHBJ3HMIRyf
hww43yvddUDYUnbNOKjhv3sLhCA4YD
uY6zQtBC6miwLUl3jkCVVA0Xu8ASgj
jv58qu46VW7LvRIq4txNE8bG9NBlZl
pzaMkydAiCHCF5H2oQVqMn4DTTYgNL
yoN2A9LyrCwLfjP1ad9HMAwxExJL5i
J27iy2L90m9dpcPLJ8tl46GGb9xqmQ
6YwFCvuPHyyEwnctUTpqLFcvUafVZ2
Nuq9XgIgRQGynjlVqGLMOpO0MkGpsn
tChkRG7eoRuKVXgW7ccTGx45E54K3Y
qPv48XqdGlOrdULCOGZ45kwJ1v5kVX
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="col"></a>5.8.10. col - filter reverse line feeds from input</h3></div></div></div>
<p>清除 ^M 字符</p>
<pre class="screen">
$ cat oldfile | col -b > newfile
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="apg"></a>5.8.11. apg - generates several random passwords</h3></div></div></div>
<pre class="screen">
sudo apt-get install apg
$ apg
Please enter some random data (only first 16 are significant)
(eg. your old password):>
imlogNukcel5 (im-log-Nuk-cel-FIVE)
Drocdaf1 (Droc-daf-ONE)
fagJook0 (fag-Jook-ZERO)
heabugJer4 (heab-ug-Jer-FOUR)
5OsEsudy (FIVE-Os-Es-ud-y)
IrjOgneagOc9 (Irj-Og-neag-Oc-NINE)
$ apg -M SNCL -m 16
WoidWemFut6dryn,
byRowpEus-Flutt0
|QuogCagFaycsic0
ojHoadCyct4Freg_
Vir9blir`orhohoo
bapOip?Ibreawov2
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="head"></a>5.8.12. head/tail</h3></div></div></div>
<pre class="screen">
head -c 17 | tail -c 1
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="rev"></a>5.8.13. 反转字符串或文件内容</h3></div><div><h4 class="subtitle">rev - reverse lines of a file or files</h4></div></div></div>
<p>反转字符串 </p>
<pre class="screen">
# echo hello | rev
olleh
# echo "hello world" | rev
dlrow olleh
</pre>
<p>反转文件内容 </p>
<pre class="screen">
# rev /etc/passwd
hsab/nib/:toor/:toor:0:0:x:toor
nigolon/nibs/:nib/:nib:1:1:x:nib
nigolon/nibs/:nibs/:nomead:2:2:x:nomead
nigolon/nibs/:mda/rav/:mda:4:3:x:mda
nigolon/nibs/:dpl/loops/rav/:pl:7:4:x:pl
cnys/nib/:nibs/:cnys:0:5:x:cnys
nwodtuhs/nibs/:nibs/:nwodtuhs:0:6:x:nwodtuhs
tlah/nibs/:nibs/:tlah:0:7:x:tlah
nigolon/nibs/:liam/loops/rav/:liam:21:8:x:liam
nigolon/nibs/:pcuu/loops/rav/:pcuu:41:01:x:pcuu
nigolon/nibs/:toor/:rotarepo:0:11:x:rotarepo
nigolon/nibs/:semag/rsu/:semag:001:21:x:semag
nigolon/nibs/:rehpog/rav/:rehpog:03:31:x:rehpog
nigolon/nibs/:ptf/rav/:resU PTF:05:41:x:ptf
nigolon/nibs/:/:ydoboN:99:99:x:ydobon
nigolon/nibs/:ved/:renwo yromem elosnoc lautriv:96:96:x:ascv
nigolon/nibs/:ptn/cte/::83:83:x:ptn
nigolon/nibs/:htualsas/ytpme/rav/:"resu dhtualsaS":67:994:x:htualsas
nigolon/nibs/:xiftsop/loops/rav/::98:98:x:xiftsop
nigolon/nibs/:dhss/ytpme/rav/:HSS detarapes-egelivirP:47:47:x:dhss
hsab/nib/:lqsym/bil/rav/:revres LQSyM:994:894:x:lqsym
hsab/nib/:www/:noitacilppA beW:08:08:x:www
nigolon/nibs/:xnign/ehcac/rav/:resu xnign:894:794:x:xnign
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="expand"></a>5.8.14. TAB符号与空格处理</h3></div></div></div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp84"></a>5.8.14.1. expand - convert tabs to spaces</h4></div><div><h5 class="subtitle">转换 TAB 字符为空格</h5></div></div></div>
<pre class="screen">
root@netkiller /var/log % yum --showduplicates list httpd | expand
Repository epel is listed more than once in the configuration
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
httpd.x86_64 2.4.6-67.el7.centos os
httpd.x86_64 2.4.6-67.el7.centos.2 updates
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="unexpand"></a>5.8.14.2. unexpand - convert spaces to tabs</h4></div><div><h5 class="subtitle">转换空格为TAB符</h5></div></div></div>
<pre class="screen">
root@netkiller /var/log % cat /etc/fstab | unexpand -t 16
/dev/vda1 / ext3 noatime,acl,user_xattr 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
</pre>
<p>将16个空格替换为一个TAB符</p>
</div>
</div>
</div><div xmlns="" id="disqus_thread"></div><script xmlns="">
var disqus_config = function () {
this.page.url = "http://www.netkiller.cn"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = 'netkiller'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//netkiller.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script><noscript xmlns="">Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript><br xmlns="" /><script xmlns="" type="text/javascript" id="clustrmaps" src="//cdn.clustrmaps.com/map_v2.js?u=r5HG&d=9mi5r_kkDC8uxG8HuY3p4-2qgeeVypAK9vMD-2P6BYM"></script><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="numeric.html">上一页</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">上一级</a></td><td width="40%" align="right"> <a accesskey="n" href="grep.html">下一页</a></td></tr><tr><td width="40%" align="left" valign="top">5.7. Numeric </td><td width="20%" align="center"><a accesskey="h" href="../index.html">起始页</a></td><td width="40%" align="right" valign="top"> 5.9. grep, egrep, fgrep, rgrep - print lines matching a pattern</td></tr></table></div><script xmlns="">
(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-11694057-1', 'auto');
ga('send', 'pageview');
</script><script xmlns="" async="async">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?93967759a51cda79e49bf4e34d0b0f2c";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script><script xmlns="" async="async">
(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 xmlns="" type="text/javascript" src="/js/q.js" async="async"></script></body></html>