随笔分类 -  linux shell

上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 78 下一页
摘要:1、 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt 1 3 8 1 3 5 1 7 root@PC1:/home/test# sort test.txt | uniq -d ## 取出重复项 1 3 root@P 阅读全文
posted @ 2022-01-21 15:36 小鲨鱼2018 阅读(241) 评论(0) 推荐(0)
摘要:1、 root@PC1:/home/test# ls test.sh root@PC1:/home/test# cat test.sh #!/bin/bash #using a function in a script function func1 { ## shell自定义函数的格式之一是 fun 阅读全文
posted @ 2022-01-16 13:18 小鲨鱼2018 阅读(263) 评论(0) 推荐(0)
摘要:1、 root@PC1:/home/test# ls root@PC1:/home/test# for i in {A..D}; do for j in {A..D}; do echo $i"_"$j; done; done ## 生成A-D任意的两两组合 A_A A_B A_C A_D B_A B 阅读全文
posted @ 2022-01-15 16:56 小鲨鱼2018 阅读(352) 评论(0) 推荐(0)
摘要:linux 中awk命令实现统计频数 1、 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt 3 4 6 3 2 4 8 2 1 5 6 2 4 3 6 1 2 4 7 3 3 4 7 2 root@PC1:/home/test 阅读全文
posted @ 2022-01-15 10:55 小鲨鱼2018 阅读(512) 评论(0) 推荐(0)
摘要:1、循环数字 root@PC1:/home/test# ls root@PC1:/home/test# for((i = 1; i <= 5; i++)); do echo $i; done 1 2 3 4 5 2、 root@PC1:/home/test# ls root@PC1:/home/te 阅读全文
posted @ 2022-01-15 10:30 小鲨鱼2018 阅读(260) 评论(0) 推荐(0)
摘要:1、获取环境变量 export env 2、测试export 和 env: root@PC1:/home/test# ls root@PC1:/home/test# export > export.txt ## 生成文件 root@PC1:/home/test# ls export.txt root 阅读全文
posted @ 2022-01-15 00:18 小鲨鱼2018 阅读(1294) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt 3 4 2 2 1 9 5 7 5 7 8 4 2 3 4 6 2、统计每行数据的最大值 root@PC1:/home/test# ls test.tx 阅读全文
posted @ 2022-01-14 22:02 小鲨鱼2018 阅读(913) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt 3 4 2 2 1 9 5 7 5 7 8 4 2 3 4 6 2、实现计算每行的和 root@PC1:/home/test# ls test.txt 阅读全文
posted @ 2022-01-14 21:34 小鲨鱼2018 阅读(3253) 评论(14) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt 3 4 2 2 1 9 5 7 5 7 8 4 2 3 4 6 2、输出每一列的最大值 root@PC1:/home/test# ls test.txt 阅读全文
posted @ 2022-01-14 21:20 小鲨鱼2018 阅读(931) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt 3 4 2 9 1 3 5 4 3 7 8 4 2 3 4 6 2、对每一列数据进行求和 root@PC1:/home/test# ls test.tx 阅读全文
posted @ 2022-01-14 20:56 小鲨鱼2018 阅读(2476) 评论(0) 推荐(0)
摘要:linux中date命令用于获取当前的日期 1、 root@PC1:/home/test# date ##在终端直接输入date即可获取当前的日期信息 2022年 01月 14日 星期五 12:30:42 CST 2、 root@PC1:/home/test# date +%Y ##年 2022 r 阅读全文
posted @ 2022-01-14 12:38 小鲨鱼2018 阅读(2630) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls a.txt test.txt root@PC1:/home/test# cat test.txt 3 s j d z 4 x c 8 3 f z c m d root@PC1:/home/test# cat a.txt 1 2 3 2、 阅读全文
posted @ 2022-01-14 12:18 小鲨鱼2018 阅读(551) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls test.map root@PC1:/home/test# cat test.map 01 SNP01 55910 02 SNP02 85204 03 SNP03 122948 04 SNP04 203750 05 SNP05 31270 阅读全文
posted @ 2022-01-14 00:11 小鲨鱼2018 阅读(2751) 评论(0) 推荐(0)
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.map root@DESKTOP-1N42TVH:/home/test2# cat a.map ##测试数据 1 s64199.1 0 55910 1 OAR19_64675012.1 0 85204 1 O 阅读全文
posted @ 2022-01-10 23:49 小鲨鱼2018 阅读(329) 评论(0) 推荐(0)
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt aa 2413 bb 3322 cc 4231 root@DESKTOP-1N42TVH:/home/test2 阅读全文
posted @ 2022-01-10 12:39 小鲨鱼2018 阅读(272) 评论(0) 推荐(0)
摘要:1、-k 指定域 + 位置 root@DESKTOP-1N42TVH:/home/test# ls a.txt root@DESKTOP-1N42TVH:/home/test# cat a.txt ## 测试数据 google 110 5000 baidu 100 5000 guge 50 3000 阅读全文
posted @ 2022-01-10 12:29 小鲨鱼2018 阅读(780) 评论(0) 推荐(0)
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test# ls a.txt root@DESKTOP-1N42TVH:/home/test# cat a.txt 01 02 03 04 05 06 07 08 09 11 12 13 14 15 16 17 18 19 2、实现 阅读全文
posted @ 2022-01-08 20:19 小鲨鱼2018 阅读(389) 评论(0) 推荐(0)
摘要:1、测试数据 root@DESKTOP-1N42TVH:/home/test# ls a.txt root@DESKTOP-1N42TVH:/home/test# cat a.txt 01 11 02 12 03 13 04 14 05 15 06 16 07 17 08 18 09 19 10 2 阅读全文
posted @ 2022-01-08 20:01 小鲨鱼2018 阅读(2065) 评论(0) 推荐(0)
摘要:1、 root@DESKTOP-1N42TVH:/home/test2# ls outcome.map root@DESKTOP-1N42TVH:/home/test2# gzip -c outcome.map > test.gz ## 压缩并保留源文件 root@DESKTOP-1N42TVH:/ 阅读全文
posted @ 2022-01-07 17:51 小鲨鱼2018 阅读(844) 评论(0) 推荐(0)
摘要:1、 root@DESKTOP-1N42TVH:/home/test# ls outcome.map root@DESKTOP-1N42TVH:/home/test# cat outcome.map ## 测试数据 1s64199.1055910 1OAR19_64675012.1085204 1O 阅读全文
posted @ 2022-01-06 23:33 小鲨鱼2018 阅读(257) 评论(0) 推荐(0)

上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 78 下一页