uniq

用于移除或发现文件中重复的条目。

注意:此命令对连续的重复行才能正确统计,使用时最好搭配sort命令。

常用选项

-c  --count

-d  --repeated

-D  --all-repeated

-u  --unique

-w  --check-chars

-s  --skip-chars

-f  --skip-fields

uniq_help

$ uniq --helpUsage: uniq [OPTION]... [INPUT [OUTPUT]]
Filter adjacent matching lines from INPUT (or standard input),
writing to OUTPUT (or standard output).With no options, matching lines are merged to the first occurrence.Mandatory arguments to long options are mandatory for short options too.-c, --count           prefix lines by the number of occurrences-d, --repeated        only print duplicate lines, one for each group-D, --all-repeated[=METHOD]  print all duplicate linesgroups can be delimited with an empty lineMETHOD={none(default),prepend,separate}-f, --skip-fields=N   avoid comparing the first N fields--group[=METHOD]  show all items, separating groups with an empty lineMETHOD={separate(default),prepend,append,both}-i, --ignore-case     ignore differences in case when comparing-s, --skip-chars=N    avoid comparing the first N characters-u, --unique          only print unique lines-z, --zero-terminated  end lines with 0 byte, not newline-w, --check-chars=N   compare no more than N characters in lines--help     display this help and exit--version  output version information and exitA field is a run of blanks (usually spaces and/or TABs), then non-blank
characters.  Fields are skipped before chars.Note: 'uniq' does not detect repeated lines unless they are adjacent.
You may want to sort the input first, or use 'sort -u' without 'uniq'.
Also, comparisons honor the rules specified by 'LC_COLLATE'.GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report uniq translation bugs to <http://translationproject.org/team/>
For complete documentation, run: info coreutils 'uniq invocation'

Have Fun

Linux 文本去重——uniq相关推荐

  1. linux文本去重分割,Linux命令去重统计排序

    利用Linux命令进行文本按行去重并按重复次数排序 linux命令行提供了非常强大的文本处理功能,组合利用linux命令能实现好多强大的功能.本文这里举例说明如何利用Linux命令行进行文本按行去重并 ...

  2. linux之去重uniq命令详解

    linux之去重uniq命令详解 uniq是对文本文件进行行去去重的工具. 以行为单位,进行行与行之间的字符串比较并进行去重 只能对有序的文本行进行有效去重,所以常与sort命令结合使用 参数 解释 ...

  3. Linux 去重uniq命令详解

    linux之去重uniq命令详解 uniq是对文本文件进行行去去重的工具. 以行为单位,进行行与行之间的字符串比较并进行去重 只能对有序的文本行进行有效去重,所以常与sort命令结合使用 参数 解释 ...

  4. linux统计排序命令,Linux命令去重统计排序

    利用Linux命令进行文本按行去重并按重复次数排序 linux命令行提供了非常强大的文本处理功能,组合利用linux命令能实现好多强大的功能.本文这里举例说明如何利用Linux命令行进行文本按行去重并 ...

  5. Linux中sort,uniq,cut,wc命令详解

    Linux中sort,uniq,cut,wc命令详解 来源:hellodev 本文主要对Linux中sort,uniq,cut,wc这4个命令的使用方法进行了详细说明,希望对你有所帮助. sort s ...

  6. Linux文本处理工具和正则表达式

    成功不易,加倍努力! 1 文本编辑工具之神VIM 1.1命令或普通(Normal)模式的基本命令 1.2 插入(Insert)或编辑模式的基本命令 1.3 扩展命令模式基本命令 1.4 vim的寄存器 ...

  7. linux 下 grep -c sh* /etc/passwd,Linux文本处理三剑客--grep

    稍微接触过linux都会知道有三个非常强大文本处理工具,那就是grep.sed和awk,想必都有听说过吧. Linux文本处理三剑客: grep, egrep, fgrep:文本过滤工具(模式:pat ...

  8. 编程小技巧之 Linux 文本处理命令(二)

    合格的程序员都善于使用工具,正所谓君子性非异也,善假于物也.合理的利用 Linux 的命令行工具,可以提高我们的工作效率. 本篇文章是<Linux 文本处理命令> 续篇,在前文的基础上再介 ...

  9. 告别linux重复操作,学习linux文本处理工具,真正实用性入门教学linux基础命令之文本管理-----进阶sre第一阶段(重温linux基础06)

    文本处理工具 cut(实用) 取出文件中的列 cut 列分隔符 指定列 文件名 cut -d: -f1,3 /etc/passwd cut -d: -f1,3-5 /etc/passwd df -h ...

  10. linux文本三剑客演讲稿,linux文本三剑客之grep

    grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正 ...

最新文章

  1. 在QT搭建的播放器外壳中嵌入SDL的窗口
  2. php 发送带附件的邮件,php发送带附件的电子邮件
  3. Laravel 源码解读:php artisan make:auth
  4. Python文件修改的两种方式
  5. How to be a hacker
  6. 《用友ERP-U8(8.72版)标准财务模拟实训》——导读
  7. matlab字符和字符串,MATLAB字符和字符串
  8. django 1.8 官方文档翻译: 1-2-4 编写你的第一个Django应用,第4部分
  9. 在Ubuntu中安装MySQL (转载)
  10. oracle多边形经纬范围筛选_Oracle数据库之Oracle spatial空间查询的选择度分析
  11. 【21.09-21.10】近日Paper Quichthrough汇总
  12. 2019半年总结——学习与成长
  13. 人工智能 - paddlepaddle飞桨 - 深度学习基础教程 - 数字识别
  14. 阿里大数据之路:数据管理篇大总结
  15. java调用微信支付流程
  16. python字符串格式时间转化为时间戳
  17. MySQL如何查询表中重复的数据
  18. 错误处理机制perror的详解
  19. 关于嵌入式的技术竞争力需要花点时间整理一下给大家
  20. C语言之最简单的Hello World!

热门文章

  1. 微信小程序轮播图(详细)
  2. 百度 bos php,GitHub - SwimmingTiger/BOSFS: PHP流包装器:百度开放云对象存储文件系统(BCE BOS File System)...
  3. 工业软件深度:中国PLM/MES/SCADA/DCS格局与主要玩家分析~
  4. 工业树莓派在激光雕刻中的应用
  5. javaweb实现pdf预览
  6. 天气类App原型制作分享-ColorfulClouds
  7. 可汗学院统计学课程总结
  8. 几款实用的linux工具
  9. JAVA毕业设计共享汽车管理系统计算机源码+lw文档+系统+调试部署+数据库
  10. javaScript之原生js封装组件(弹窗为例)