上一页 1 ··· 135 136 137 138 139 140 141 142 143 ··· 408 下一页
摘要: 001、 统计单个元素 a <- c(3, 3 , 3, 2, 7, 2, 3) ## 测试向量 sum(a == 3) ## 统计3在向量中出现的次数 sum(a == 2) 002、 a <- c(3, 3 , 3, 2, 7, 2, 3) table(a) ## 统计所有元素的频次 003、适 阅读全文
posted @ 2023-02-26 16:59 小鲨鱼2018 阅读(353) 评论(0) 推荐(0)
摘要: 001、 系统 root@ubuntu01:/etc/netplan# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 阅读全文
posted @ 2023-02-25 20:40 小鲨鱼2018 阅读(4284) 评论(0) 推荐(0)
摘要: 001、q,表示退出(匹配地址后退出sed脚本) [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 22 jj yy ss ff xx zz vv bb dd 00 ss 99 cc mm bb tt yy [root@PC1 阅读全文
posted @ 2023-02-25 17:14 小鲨鱼2018 阅读(339) 评论(0) 推荐(0)
摘要: 001、指定列的输入分隔符 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt aa:bb:cc 11:22:33 55:88:33 [root@PC1 test]# awk -F ":" '{print $2}' a.txt ## 使用-F 选 阅读全文
posted @ 2023-02-25 17:08 小鲨鱼2018 阅读(3279) 评论(0) 推荐(0)
摘要: 001、 ctrl + a: 将光标移动到命令行的开头,相当于键盘中的home键 002、 ctrl + e: 将光标移动到命令行的结尾,相当于键盘中的end键 003、ctrl + u: 剪切光标所在位置之前的内容 004、ctrl + k: 剪切光标所在位置之后的内容 005、ctrl + y: 阅读全文
posted @ 2023-02-25 09:48 小鲨鱼2018 阅读(87) 评论(0) 推荐(0)
摘要: 001、普通数组 普通数组的定义: ay=(100 200 300 "aa" "bb") ## 直接定义 [root@PC1 test]# ay2[0]=800 ## 单独定义每一个元素 [root@PC1 test]# ay2[1]="aaaa" [root@PC1 test]# ay2[2]=5 阅读全文
posted @ 2023-02-24 23:48 小鲨鱼2018 阅读(76) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls test.sh [root@PC1 test]# cat test.sh ## 测试脚本 #!/bin/bash read -p "please input an character:" key ## 给变量key赋值 case $key in ## 阅读全文
posted @ 2023-02-24 22:52 小鲨鱼2018 阅读(33) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a b c 3 d b e 7 a d e 8 z b c 4 a d e 1 [root@PC1 test]# awk '{array[$2] += $4} END 阅读全文
posted @ 2023-02-24 12:27 小鲨鱼2018 阅读(66) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bb kk aa qq kk 11 kk dd kk mm xx [root@PC1 test]# cat -A a.txt ## 可以看到有tab制表符 aa^ 阅读全文
posted @ 2023-02-22 22:40 小鲨鱼2018 阅读(608) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bb cc dd 11 22 33 [root@PC1 test]# cat -A a.txt ## cat -A , tab键显示为^I aa bb^Icc^I 阅读全文
posted @ 2023-02-22 22:33 小鲨鱼2018 阅读(335) 评论(0) 推荐(0)
上一页 1 ··· 135 136 137 138 139 140 141 142 143 ··· 408 下一页