|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
* N- M! H, q. c( k7 d4 G4 X
Linux fold命令用于限制文件列宽。
5 n- H0 H& J2 p9 T3 t
: o. i4 {: y x- m3 |fold指令会从指定的文件里读取内容,将超过限定列宽的列加入增列字符后,输出到标准输出设备。若不指定任何文件名称,或是所给予的文件名为"-",则fold指令会从标准输入设备读取数据。* ~. B7 z! d* x; M
) x% u, c9 L. O- r5 ]( u6 r( A
" s* [4 c, p) n# o语法1 O% ~$ a% t; v: ?5 s
3 G1 ?8 a* u8 B4 n
fold [-bs][-w<每列行数>][--help][--version][文件...]- ~+ Q, E. v& ]8 O, o: l
0 w* V% ]7 Q6 ]+ ~9 V
/ Q$ F% v K( g8 B4 o) D9 o0 v3 z1 r1 @1 q
参数:
3 Z8 e) r3 B/ n$ O* b7 K2 @
: X7 M: [6 Y/ @- s' C0 F-b或--bytes 以Byte为单位计算列宽,而非采用行数编号为单位。& U# \1 |4 F$ P I; p
-s或--spaces 以空格字符作为换列点。" S" Z' x: Q- H. f% P) u
-w<每列行数>或--width<每列行数> 设置每列的最大行数。( o% E5 w) R+ i2 }' y
--help 在线帮助。
5 H" ]! r( _5 a/ S) ]--version 显示版本信息。7 B% n, }6 Z0 W; G
9 J. A _8 R. O6 h3 T
6 P/ @$ x7 q) \0 l% H3 K
# A5 Q2 C0 }( Y5 [& @# a8 M实例1 a6 O" w$ u9 B2 q @
, R; t" ]' ~( x: M3 B6 Z/ \将一个名为testfile 的文件的行折叠成宽度为30,可使用如下命令:
1 w z8 d( I: G4 D* g, |+ e+ G4 Q( O2 E+ X) l( L& Y
fold -w 30 testfile; X. Y8 B2 ]' {5 P5 R7 a
2 H. _1 a5 w1 N# J2 o4 x5 g
& v, M: O( A9 J4 \0 h
为了对比,先将testfile文件输出如下:: [* D9 R7 O; p: E, z; J0 g0 o
8 U, G5 O0 w& l8 a6 O$ cat testfile #查看testfile 中的内容 1 w4 Z% k4 z; c: V; T( H
Linux networks are becoming more and more common, but
% y% }9 n4 ]* [" J" q* @7 wsecurity is often an overlooked
' A+ m4 D$ f, I6 R" n4 Missue. Unfortunately, in today’s environment all networks
+ E% l- _' T3 {" V( Gare potential hacker targets, 4 z. ^ u+ M: u$ w
from top-secret military research networks to small home LANs.
+ p5 v7 e9 g8 @" m: kLinux Network Security focuses on securing Linux in a / t y$ I* A1 h4 b2 t0 V: h
networked environment, where the 3 C, m/ `. W7 _! J5 ^$ u# y
security of the entire network needs to be considered 8 o3 i. v) ^' }" U8 Y
rather than just isolated machines. 7 s, f7 E" S& S7 j, Y( `6 d
It uses a mix of theory and practical techniques to
5 P4 f9 f' e! b4 fteach administrators how to install and 0 q( |! r% E' \
use security applications, as well as how the
2 W3 {' X7 ]; R" Lapplications work and why they are necessary. ' i5 v7 R6 h4 M8 s+ f
/ u/ b5 e; C1 @# P% J: E9 G
' V' Q5 @5 S9 v( ~; _然后使用fold命令折叠显示:
+ P- V, T. m. O. r3 Q) w0 G# e9 e5 P
$ fold -w 30 testfile #行折叠成宽度为30,显示testfile 文件
- \( C5 m o' y# FLinux networks are becoming mo 8 s9 V2 Y7 ~" Y& u. O% v5 M, Z2 X7 @
re and more common, but securi - T: W8 \% U& a+ A# ?2 Z* F; g
ty is often an overlooked issu
; X( r+ F$ D, A8 C" xe. Unfortunately, in today’s 2 i; b8 r9 K# }4 I( `! K% f
environment all networks are
; S% S2 y' u- h% u4 G8 t/ kpotential hacker targets, from
/ E0 O" @, O, c; f0 {% jtop-secret military research
) R. C1 q: K. F1 p& znetworks to small home LANs.
! X% u9 ~7 f& uLinux Network Security focuses ; N8 I# M, a% I9 d
on securing Linux in a networ
3 n; p. V* q# Hked environment, where the sec 6 O Q! x/ x1 |; F
urity of the entire network ne / t4 \9 K( l7 \; Z4 h
eds to be considered rather th ) X7 r$ Z0 y5 i; Z- L
an just isolated machines. It , v Q$ Z6 r8 A4 I! l
uses a mix of theory and pract r5 F7 Y; C, z
ical techniques to teach admin
) W) ?! Z Z1 N: a& v! z2 ~! }& Iistrators how to install and u 3 u j; K) ^. @$ o% \
se security applications, as w ) v7 m# j r$ C! Z" B8 w
ell as how the applications wo ( l" m$ ~2 u$ r- `6 f2 N" R
rk and why they are necessary 1 _: B7 C! c4 p0 {
|
|