zoukankan      html  css  js  c++  java
  • Linux Sysadmin Basics 4.1 -- Filtering Output and Finding Things (&&, cut, sort, uniq, wc, grep)

    • cut OPTION… [FILE]…

      remove sections from each line of files

      -d, --delimiter=DELIM
                    use DELIM instead of TAB for field delimiter

      -f, --fields=LIST
                    select only these fields; also print any line that contains no delimiter character, unless the -s option is specified

    • sort [OPTION]... [FILE]...

      or sort [OPTION]... --files0-from=F

      sort lines of text files

      -b, --ignore-leading-blanks
                    ignore leading blanks

      -f, --ignore-case
                    fold lower case to upper case characters

    • uniq [OPTION]... [INPUT [OUTPUT]]

      report or omit repeated lines

    • wc [OPTION]... [FILE]...

      or wc [OPTION]... --files0-from=F

      print newline, word, and byte counts for each file

    • grep [OPTIONS] PATTERN [FILE...]

      or grep [OPTIONS] -e PATTERN ... [FILE...]

      or grep [OPTIONS] -f FILE ... [FILE...]

      print lines matching a pattern


    # file.txt

    dave:we

    user:love

    someone:linux

    someone:linux

    prog1 && prog2
    cat file.txt | cut -d: -f2
    cat file.txt | sort -bf
    cat file.txt | uniq
    wc file.txt
    cat file.txt | grep user
    
  • 相关阅读:
    jsp+servlet实现的验证登陆
    Servlet转发
    ServletContext的使用
    Servlet获取配置信息(ServletConfig)
    Servlet线程安全问题(转载)
    编程式导航
    声明式导航
    Vue Router
    路由
    vue-cli 单文件组件 工具安装
  • 原文地址:https://www.cnblogs.com/goldenretriever/p/14332748.html
Copyright © 2011-2022 走看看