使用cut命令获取文档中的某一列的数据,例如下面的文件cut.tab中间使用tab键分隔,这里要想只显示第3个列区域的内容,可以使用 cut -f3 cut.tab实现。下面学习啦小编就跟大家说说LINUX CUT命令的说明,欢迎大家阅读!!!

LINUX CUT命令的介绍

1用命令vi cut.tab创建一个cut.tab的文件

2在cut.tab文件中输入如下内容,单词之间用tab作为分隔符。

3输入:wq保存,并退出

4cat查看cut.tab文件的所有内容

[lele@Oracle ~]$ cat cut.tab

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

one two three four five six seven

5使用cut命令,带上-f参数,例如下面是要查看cut.tab文件的第3列的内容

[lele@Oracle ~]$ cut -f3 cut.tab

three

three

three

three

three

three

three

three

three

three

three

three

three

three

three

three

three

three

three

参数-f3的意思就是以tab键的空格为分隔符,截取第3段

6用cat cut.tab查看文件中的内容,如果不保存,最后输入:q即可退出。

linux cut最后一列,LINUX CUT命令的介绍相关推荐

  1. Linux 命令行操作 while read ; cut 提取指定列; uniq命令并计数;sort 命令倒序查找

    while read 命令 ls *txt* | while read line; do other-operate-command; done cut -f 命令 提取文件中第17 20列 zcat ...

  2. linux ls lh每个列,Linux ls命令用法

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? 1.ls命令简介 ls 命令是 Linux 下最常用的命令.ls 命令就是 list 的缩写,缺省下 ls 用来打印出当 ...

  3. linux去重某一列,Linux shell命令统计某列去重后的值

    需求:根据mac获取,mac对应的硬件版本和软件版本.在根据硬件版本统计mac的数量 $ head test_1.txt 00:07:67,ec2108,hwv010537p0000 00:07:63 ...

  4. linux中用截取一些信息,Linux如何使用cut命令截取文件信息

    在Linux众多命令中,cut命令可用来截取文件信息,截取Linux字符串,下面将针对cut命令的用法做个详细介绍,感兴趣的朋友可以来学习下. cut命令有截取的意思,可从linux文件或者标准输入中 ...

  5. Linux Shell脚本编程--cut命令

    cut cut命令可以从一个文本文件或者文本流中提取文本列. cut语法 [root@www ~]# cut -d'分隔字符' -f fields <==用于有特定分隔字符 [root@www ...

  6. Linux中sort、uniq、cut、wc命令详解

    sort sort 命令对 File 参数指定的文件中的行排序,并将结果写到标准输出.如果 File 参数指定多个文件,那么 sort 命令将这些文件连接起来,并当作一个文件进行排序. sort语法[ ...

  7. linux 截取列_Linux 常用命令汇总

    Linux命令太多,主要写写自己平时使用频率较高的常用命令,内容是自己的笔记内容,所以整个逻辑看起来会比较乱.每条认真看,看完会有收获哦. 文中会出现大部分的伪代码,只是帮助自己记忆的. 1.LINU ...

  8. linux中将文本中的单词换掉的指令_从零开始学Linux运维|19.文本处理相关命令(2)...

    1.tr tr用于替换文本文件中的字符,格式为"tr [要替换的字符] [替换后的字符]" tr不能用于替换完整字符串,只能替换对应的字符 将小写都替换成大写"cat t ...

  9. linux切换到顶层命令,一些在Linux下提高工作效率的常用命令

    Linux一些常用命令介绍 一.查看系统端口命令: 1.netstat :非root用户即可执行 netstat -anp|grep [Port|PID|Server Name] 2.lsof :必须 ...

最新文章

  1. 数据结构和算法:(3)3.2.1单链表的整表创建
  2. 关于磁盘,磁柱,磁头,扇区的概念
  3. 翻译:集群索引:通往SQL Server索引级别3的阶梯
  4. Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTag
  5. DRILLNET 2.0------第十八章 起下钻水力参数计算模型
  6. JAVA中的观察者模式observer
  7. ASP.NET快速入门
  8. 基于arduino单片机的室内温度控制
  9. linux非连续内存,(转)linux高端内存管理之非连续内存区(分配和释放)
  10. poj1723 SOLDIERS
  11. 知乎页面的html代码,仿知乎当复制网页内容时在尾部加入版权信息代码
  12. 《算法图解》学习笔记(七):狄克斯特拉算法(附代码)
  13. 自学B站小甲鱼数据结构课程-C语言实现基础数据结构-栈-的例子
  14. Android Study 之 SQLite 了解与基本运用
  15. Html 分页自动控制、分页自动生成、分页数量可控制
  16. 郑州大学微型计算机原理与接口技术,《微机原理及接口技术》第01章在线测试...
  17. EXCEL无格式黏贴
  18. php curlclose,PHP curl_close函数 - PHP 教程 - 自强学堂
  19. wget 整站抓取的好工具
  20. 无机化学(第四版)(上册、下册)课后答案 宋天佑 徐家宁 程功臻 王莉版答案解析 高等教育出版社 第5章课后题答案 习题解答

热门文章

  1. 终于,今天40岁了!
  2. Star-CCM+询问帖
  3. Apollo 分布式部署指南
  4. linux防火墙 开放端口配置
  5. 最实际与高效生成数据库高级声明式SQL脚本神器研发
  6. Android APP第三方支付流程
  7. 用户SA登陆失败 | VS三层架构web项目的创建
  8. 经验干货:使用tf.py_func函数增加Tensorflow程序的灵活性
  9. C#Linq中的Select方法的说明
  10. AdsPower同时开启多账户工作与切换家庭多账号