linux文件内容格式化,Linux文件内容操作(六) 格式化文本 fmt

使用fmt(format)命令可以将文本格式化。

fmt命令行选项:

选项

含义

-w,--width=N,-N

将文本格式化成N列(默认为75)

-p,--prefix=STRING

只对以STRING字符串开始的行进行格式化

-u,--uniform-spacing

强行执行字与字之间一个空格,句子之间两个空格

[root@localhost ~]# cat fmttest

#

# Generated automatically from man.conf.in by the

# configure script.

#

# man.conf from man-1.6d

#

# For more information about this file, see the man pages man(1)

# and man.conf(5).

#

# This file is read by man to configure the default manpath (also used

[root@localhost ~]# fmt -40 fmttest

# # Generated automatically from

man.conf.in by the # configure script.

# # man.conf from man-1.6d # # For more

information about this file, see the

man pages man(1) # and man.conf(5).#

# This file is read by man to configure

the default manpath (also used

[root@localhost ~]# fmt -40 -p '#' fmttest

# Generated automatically from

# man.conf.in by the configure script.

# man.conf from man-1.6d

# For more information about this

# file, see the man pages man(1)

# and man.conf(5).

# This file is read by man to configure

# the default manpath (also used

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值