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
    
  • 相关阅读:
    java冒泡算法和选择排序法
    JDBC操作数据库,比如修改电商数据库中的分类的id,让各商品随机
    RF使用
    安装RF框架(基于Python)
    selenium+java的常使用的一些操作
    selenium的常用操作
    selenium的8种定位方式(java举例)
    服务管理
    Linux软件安装
    项目依赖
  • 原文地址:https://www.cnblogs.com/goldenretriever/p/14332748.html
Copyright © 2011-2022 走看看