```shell # 01_03_05_07_09 seq -w -s_ 1 2 10 # 10 8 6 4 2 echo {10..1..2} # ABCDEFGHIJKLMNOPQRSTUVWXYZ echo {A..Z} |tr -d " " # 找code文件夹下 以.go结尾的文件 (-type d是文件夹) find ./code -type f -name "*.go" -print # 找到结果前后各加一个@ find ./code -exec echo @{}@ ";" # 将过滤出的文件ls -l一下 换而言之(换成rm就都删除了) find ./code -type f -name "*.rs" -exec ls -l {} ";" # shell 中的while loop,一直打印candide yes candide # 别像上条命令那么多 3条足矣 yes candide |head -n3 # 匹配排除空行 grep -v '^$' node.go # 匹配所有包含left和right的行 grep 'left\|right' node.go # 列出/etc/shells合法shell cut -d: -f7 /etc/passwd |sort -u |grep -f /etc/shells -F # 查看第6-8行日志 head -n 8 error.log |tail -n3 # cat反过来输出 tac 1.txt # 合并两列 paste 1.txt 2.txt # 以逗号分割行合并 paste -d, -s 1.txt 2.txt # 比较两个文件展示两个有差异的行 diff 1.txt 2.txt |grep '^[<>]' |cut -c3- # 替换结果 echo $PATH | tr : "\n" # 小写转大写 echo "candide" |tr a-z A-Z # 删掉输出中的空行 输出hellocandide echo hello candide |tr -d " " # rev反转命令,与tac不同的是,tac是行反转,这个是行字符 输出edidnac olleh echo hello candide |rev # 获取文件内容每行最后一个单词 rev 3.txt |cut -d " " -f1| rev # mock 顺序名的jpg文件 touch {1..1000}.jpg # 比较筛选缺失的顺序文件 diff <(ls *.jpg |sort -n) <(seq 1 1000 | sed 's/$/.jpg/')|grep '>' |cut -c3- ```