随笔分类 -  linux shell

上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 77 下一页
摘要:1、取正对角线 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt 1 D E 2 s d 3 d c root@PC1:/home/test# awk '{print $NR}' a.txt ## 取矩阵对角线元素,正对角线 1 阅读全文
posted @ 2022-01-23 21:40 小鲨鱼2018 阅读(93) 评论(0) 推荐(0)
摘要:1、 root@PC1:/home/test2# ls a.txt dir.1 test.csv test.ped root@PC1:/home/test2# ls -l total 8 -rw-r--r-- 1 root root 64 1月 21 23:14 a.txt drwxr-xr-x 2 阅读全文
posted @ 2022-01-21 23:45 小鲨鱼2018 阅读(431) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt ## 测试数据 chenwu 05/99 4811 27 mary 02/22 1231 30 tom 09/15 1182 25 2、 root@PC1:/h 阅读全文
posted @ 2022-01-21 23:34 小鲨鱼2018 阅读(689) 评论(0) 推荐(0)
摘要:1、测试数据 root@PC1:/home/test# ls ## 测试数据 a.txt b.txt root@PC1:/home/test# cat a.txt w s g d w a root@PC1:/home/test# cat b.txt d a e d t c 2、取两个文件的交集 so 阅读全文
posted @ 2022-01-21 18:44 小鲨鱼2018 阅读(219) 评论(0) 推荐(0)
摘要: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 阅读(232) 评论(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 阅读(195) 评论(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 阅读(346) 评论(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 阅读(506) 评论(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 阅读(257) 评论(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 阅读(1292) 评论(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 阅读(898) 评论(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 阅读(3222) 评论(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 阅读(925) 评论(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 阅读(2452) 评论(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 阅读(2623) 评论(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 阅读(534) 评论(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 阅读(2730) 评论(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 阅读(324) 评论(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 阅读(269) 评论(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 阅读(778) 评论(0) 推荐(0)

上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 77 下一页