当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > Linux指令篇档案目录管理--cut

Unix/Linux
HP工程师经验分享(34)
HP工程师经验分享(33)
HP工程师经验分享(32)
HP工程师经验分享(31)
HP工程师经验分享(30)
HP工程师经验分享(29)
HP工程师经验分享(28)
HP工程师经验分享(27)
HP工程师经验分享(26)
HP工程师经验分享(25)
HP工程师经验分享(24)
HP工程师经验分享(2)
HP工程师经验分享(23)
HP工程师经验分享(22)
HP工程师经验分享(21)
HP工程师经验分享(20)
HP工程师经验分享(19)
HP工程师经验分享(18)
HP工程师经验分享(17)
HP工程师经验分享(16)

Unix/Linux 中的 Linux指令篇档案目录管理--cut


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 76 ::
收藏到网摘: n/a

名称:cut
使用权限:所有使用者
用法:cut -cnum1-num2 filename
说明:显示每行从开头算起 num1 到 num2 的文字。
范例:
shell>> cat example
test2
this is test1
shell>> cut -c0-6 example ## print 开头算起前 6 个字元
test2
this i
cut其实很有用
-c m-n 表示显示每一行的第m个字元到第n个字元。例如:
---------file-----------
liubi 23 14000
---------file-----------
# cut -c 3-9,12-20 file
liubi 14000
-f m-n 表示显示第m栏到第n栏(使用tab分隔)。例如:
---------file-----------
liubi 23 14000
---------file-----------
# cut -f 1,3 file
liubi 14000