非常教程

Linux参考手册

Linux fold命令

Linux fold命令

Linux fold命令

Linux fold命令

Linux 命令大全

Linux fold命令用于限制文件列宽。

fold指令会从指定的文件里读取内容,将超过限定列宽的列加入增列字符后,输出到标准输出设备。若不指定任何文件名称,或是所给予的文件名为"-",则fold指令会从标准输入设备读取数据。

语法

fold [-bs][-w<每列行数>][--help][--version][文件...]

参数

  • -b或--bytes 以Byte为单位计算列宽,而非采用行数编号为单位。
  • -s或--spaces 以空格字符作为换列点。
  • -w<每列行数>或--width<每列行数> 设置每列的最大行数。
  • --help 在线帮助。
  • --version 显示版本信息。

实例

将一个名为testfile 的文件的行折叠成宽度为30,可使用如下命令:

fold -w 30 testfile

为了对比,先将testfile文件输出如下:

$ cat testfile #查看testfile 中的内容  
Linux networks are becoming more and more common, but 
security is often an overlooked  
issue. Unfortunately, in today’s environment all networks 
are potential hacker targets,  
from top-secret military research networks to small home LANs.  
Linux Network Security focuses on securing Linux in a 
networked environment, where the  
security of the entire network needs to be considered 
rather than just isolated machines.  
It uses a mix of theory and practical techniques to 
teach administrators how to install and  
use security applications, as well as how the 
applications work and why they are necessary. 

然后使用fold命令折叠显示:

$ fold -w 30 testfile #行折叠成宽度为30,显示testfile 文件  
Linux networks are becoming mo  
re and more common, but securi  
ty is often an overlooked issu  
e. Unfortunately, in today’s  
environment all networks are  
potential hacker targets, from  
top-secret military research  
networks to small home LANs.  
Linux Network Security focuses  
on securing Linux in a networ  
ked environment, where the sec  
urity of the entire network ne  
eds to be considered rather th  
an just isolated machines. It  
uses a mix of theory and pract  
ical techniques to teach admin  
istrators how to install and u  
se security applications, as w  
ell as how the applications wo  
rk and why they are necessary 

Linux fold命令

Linux 命令大全

Linux fold命令

Linux目录

1.Linux 用户和用户组管理
2.Linux 文件与目录管理
3.Linux 磁盘管理
4.Shell 变量
5.Shell 教程
6.linux yum 命令
7.Shell 函数
8.Shell 流程控制
9.Shell test 命令
10.Shell echo命令
11.Linux cksum命令
12.Linux chown命令
13.Linux chmod命令
14.Linux chgrp命令
15.Linux chattr命令
16.Linux cat命令
17.Linux cut命令
18.Linux indent命令
19.Linux gitview命令
20.Linux git命令
21.Linux find命令
22.Linux file命令
23.Linux diffstat命令
24.Linux 命令大全
25.Linux diff命令
26.Linux cmp命令
27.Linux more命令
28.Linux mktemp命令
29.Linux mdir命令
30.Linux mdel命令
31.Linux mc命令
32.Linux mattrib命令
33.Linux lsattr命令
34.Linux locate命令
35.Linux less命令
36.Linux ln命令
37.Linux rcp命令
38.Linux patch命令
39.Linux paste命令
40.Linux od命令
41.Linux mv 命令
42.Linux mtoolstest命令
43.Linux mtools命令
44.Linux mren命令
45.Linux mread命令
46.Linux mmove命令
47.Linux mcopy命令
48.Linux cp命令
49.Linux which命令
50.Linux umask命令
51.Linux touch命令
52.Linux tmpwatch命令
53.Linux tee命令
54.Linux split命令
55.Linux slocate命令
56.Linux rm命令
57.Linux ex命令
58.Linux egrep命令
59.Linux ed命令
60.Linux csplit命令
61.Linux comm命令
62.Linux colrm命令
63.Linux col命令
64.Linux whereis命令
65.Linux rhmask命令
66.Linux mshowfat命令
67.Linux mtype命令
68.Linux look命令
69.Linux join命令
70.Linux joe命令
71.Linux jed命令
72.Linux ispell命令
73.Linux grep 命令
74.Linux fold命令
75.Linux fmt命令
76.Linux fgrep命令
77.Linux lprm命令
78.Linux wc命令
79.Linux uniq 命令
80.Linux expr命令
81.Linux tr命令
82.Linux spell命令
83.Linux sort命令
84.Linux sed 命令
85.Linux rgrep命令
86.Linux pico命令
87.Linux uucp命令
88.Linux uupick命令
89.Linux uuto命令
90.Linux tftp命令
91.Linux ncftp命令
92.Linux ftp命令
93.Linux bye命令
94.Linux lpd命令
95.Linux lpq命令
96.Linux lpr命令
97.Linux mlabel命令
98.Linux edquota命令
99.Linux du命令
100.Linux dirs命令