zoukankan      html  css  js  c++  java
  • awk, sed, xargs, bash

     
    awk:
    split($1, arr, “ ”)
    awk '{BEGIN{FS="x01"} {print $2}'
     
    sed:
    sed -n '42p' file
    sed -n '1,2p' file
    sed '42d' file
    sed 's/replace_pattern/replace_str/g' file
    sed '/remove_pattern/d' file
    sed -i [operation] file #(inplace)直接修改读取的文件内容,而不是输出到终端
     
    xargs:
    xargs -n1 -i cmd {} 
     
    bash:
    • $HOSTNAME - The hostname of the machine the script is running on.
    • Single quotes will treat every character literally.
    • Double quotes will allow you to do substitution (that is include variables within the setting of the value).
    • read varNameRead input from the user and store it in the variable varName./dev/stdinA file you can read to get the STDIN for the Bash script
    • $(( expression )) Return the result of the expression. ${#var} Return the length of the variable var.
     
  • 相关阅读:
    学习进度条73
    学习进度条72
    学习进度条71
    学习进度条70
    学习进度条69
    学习进度条68
    学习进度条67
    学习进度条66
    学习进度条65
    elasticsearch
  • 原文地址:https://www.cnblogs.com/yaoyaohust/p/10363211.html
Copyright © 2011-2022 走看看