zoukankan      html  css  js  c++  java
  • linux文件比较,合并,查找重复行

    关键命令

    sort, uniq, cat
    合并多个文件
    cat file1 file2 > newFile
    查看文件中重复行
    sort file1|uniq -d
    查看文件中唯一行
    sort file|uniq -u
    更详细的命令,请查看sort, uniq, cat命令的解释
    uniq --help

    $uniq --help
    Usage: uniq [OPTION]... [INPUT [OUTPUT]]
    Discard all but one of successive identical lines from INPUT (or
    standard input), writing to OUTPUT (or standard output).

    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
      -D, --all-repeated[=delimit-method] print all duplicate lines
                            delimit-method={none(default),prepend,separate}
                            Delimiting is done with blank lines.
      -f, --skip-fields=N   avoid comparing the first N fields
      -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
      -w, --check-chars=N   compare no more than N characters in lines
          --help     display this help and exit
          --version  output version information and exit

  • 相关阅读:
    微服务架构总结
    微服务-网关服务
    HttpClient-RestTemplate-Feign
    RPC和REST
    Springmvc的拦截器执行顺序及各方法作用
    秒杀系统优化方案(下)吐血整理
    秒杀系统优化方案(上)吐血整理
    分布式session的管理
    缓存设计——缓存和数据库的数据一致性
    个人理解的javascript作用域链与闭包
  • 原文地址:https://www.cnblogs.com/forward/p/1719363.html
Copyright © 2011-2022 走看看