随笔分类 - linux shell
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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、
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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、实现
阅读全文
摘要: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
阅读全文
摘要:1、 root@DESKTOP-1N42TVH:/home/test2# ls outcome.map root@DESKTOP-1N42TVH:/home/test2# gzip -c outcome.map > test.gz ## 压缩并保留源文件 root@DESKTOP-1N42TVH:/
阅读全文
摘要:1、 root@DESKTOP-1N42TVH:/home/test# ls outcome.map root@DESKTOP-1N42TVH:/home/test# cat outcome.map ## 测试数据 1s64199.1055910 1OAR19_64675012.1085204 1O
阅读全文

浙公网安备 33010602011771号