zoukankan      html  css  js  c++  java
  • 【shell脚本学习-2】

    #!/bin/bash - #echo do you have exetuate this project printf "please input your passwd" stty -echo read pass < /dev/tty printf "please agein input your passwd" read pass2 < /dev/tty stty echo #tr -s > 1.txt | sort > 2.txt #echo "1 6 8 1 4 9" > 1.txt | sort 1.txt | tail 1.txt #cat /dev/null #!/bin/bash #cat /bin/liupeng | grep a | wc #$1 #read $x #echo $x #set -x #跟踪 #echo firset echo #set +x #取消跟踪 #echo second echo #locale -a | grep "^L" #环境变量 #LC_ALL=da locale ck LC_TIME ######------------------------------grep+正则表达式-----------------------------# #who | grep -F u1 #判断登录用户 #cat 1.txt | grep ^a | grep b$ #cat 1.txt | grep Aa.Aa #[Aa]d #含有Aa的字符 #cat 1.txt | grep ^Aa #以Aa开头的字符 #cat 1.txt | grep Aa$ #以Aa结尾的字符 #cat 1.txt | grep [[:digit:]] | grep ^2 #匹配含有数字的行列 #cat 1.txt | grep [[:alnum:]] #cat 1.txt | grep digit #cat 1.txt | grep ab*c #匹配含有一个a额字符 #cat 1.txt | grep [[:upper:]]{3}$ #匹配后三位为大写的字符 #cat 1.txt | grep ab?c #匹配ab和abc #cat 1.txt | grep ab+c #----------------------------------sed+正则表达式_______________________________ #sed 's/:.*//' /root/1.txt #find /root -type d -print #mkdir -p /home/1 #sed 's;/home/1;/home/2;' # cat /root/1.txt | sed 's/a/B/g' #替换字符 #n #printf "hello world" #sed -n '/c/p' *.txt #sed -n '$p' "$1" #sed -n '2,5p' /root/1.txt #匹配打印的行数 echo "hello world" | sed 's/world/shell/' #替换指定的字符
    要保持着对知识的渴求,给自己充电,不要这荒废了短暂的时光;
  • 相关阅读:
    关于回溯与招聘市场
    关于回溯与马
    关于回溯和后宫
    关于兔子
    关于递归和斐波那契数列
    关于递归和汉诺塔
    关于简单汉诺塔
    nodejs报错roll back,because of a error.node.js setup wizard ended prematurel
    fatal error C1859 意外的预编译头错误,只需重新运行编译器
    sqlserver2008 无法设置主体sa的凭据
  • 原文地址:https://www.cnblogs.com/activecode/p/9526393.html
Copyright © 2011-2022 走看看