随笔分类 - linux shell
摘要:001、 创建数组 a、 declare -a array1 。 b、 array1[0]=100 。 002、删除数组 unset array1 。 003、查看数组 a、查看数组所有的元素: [root@PC1 test]# array1[0]=100 [root@PC1 test]# arra
阅读全文
摘要:Linux 中declare命令 001、普通测试 [root@PC1 dir1]# ls [root@PC1 dir1]# echo $var1 [root@PC1 dir1]# var1="hello world" [root@PC1 dir1]# echo $var1 hello world
阅读全文
摘要:001、-L :按照换行符的数量来传递 [root@PC1 dir1]# ls [root@PC1 dir1]# echo {0..9} 0 1 2 3 4 5 6 7 8 9 [root@PC1 dir1]# echo {0..9} | xargs -L 2 ## 利用echo生成一个1行的测试数
阅读全文
摘要:Linux shell中如何一次迭代传入多个变量
阅读全文
摘要:001、 Linux 中sort命令 排序指定两个-k异常 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 4 a 8 5 7 a 3 8 2 b 5 3 3 b 9 5 5 a 6 9 9 b 1 4 7 a 6 3 2 a
阅读全文
摘要:Linux中grep命令实现带有通配符.关键字符的精准匹配 001、 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试文件 new_seq KRA6 Karakaya new_seq ss
阅读全文
摘要:001、 Linux 中 awk正则匹配屏蔽原始字符串 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试文件 0M6 FKDN240280192-1A 0.51 Fail 0M7 FKDN
阅读全文
摘要:001、第一列 [root@localhost test]# ls a.txt [root@localhost test]# cat a.txt ## 测试数据 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@loc
阅读全文
摘要:001、 [root@PC1 test]# echo a | awk 'function my_length(str) {return length(str)}; {text = "Hello"; print "Length of text:", my_length(text)}' Length o
阅读全文
摘要:Linux 中 如何实现数字每个三个数字增加一个逗号 001、 [s20223040682@admin1 test]$ ls a.txt [s20223040682@admin1 test]$ cat a.txt 23453245533 9706634552 356662212 34566 [s20
阅读全文
摘要:001、 (base) [s20213040583@admin1 test]$ ls a.txt (base) [s20213040583@admin1 test]$ cat a.txt ## 测试数据 01 02 03 04 ATCkkCAA GGAaattTGccggCCAA ATCCAA05
阅读全文
摘要:001、 (base) [s20213040583@admin1 test]$ ls a.txt (base) [s20213040583@admin1 test]$ cat a.txt ## 测试数据 01 02 03 04 05 06aa 0aa7 08 09 10 1aa1 12 13 14d
阅读全文
摘要:001、 通常做法 [root@localhost test]# time seq 10 > a.txt 2> xxx ## 完全追加至xxx real 0m0.002s user 0m0.000s sys 0m0.002s [root@localhost test]# ls a.txt xxx [
阅读全文
摘要:001、 [root@localhost test]# ls a.txt [root@localhost test]# cat a.txt ## 测试数据 j003_mappingrate.txt KRA6 97.79% wild_mappingrate.txt KR.6 98.53% j004_m
阅读全文
摘要:001、 [s20223040682@admin2 test]$ echo hollo@world | fold -w 1 h o l l o @ w o r l d [s20223040682@admin2 test]$ echo hollo@world | fold -w 2 ho ll o@
阅读全文
摘要:001、 (base) [root@PC1 test]# ls a.txt idx.txt (base) [root@PC1 test]# cat a.txt ## 测试数据 01 02 03 04 05 06a 07 08 09 10 11 12 13 14b 15 16 17 18 19 20
阅读全文
摘要:001、 在Linux系统中,strings命令是一个强大且实用的工具,主要用于从二进制文件中提取可打印的字符序列。这些字符序列通常包括变量名、函数名、注释或任何嵌入的文本信息,对于文件分析和调试具有重要意义 [root@PC1 test]# ls a.txt [root@PC1 test]# ca
阅读全文
摘要:Linux中动态链接库环境变量:LD_LIBRARY_PATH 001、 [root@PC1 test]# echo $LD_LIBRARY_PATH 002、 (base) [b20223040323@admin2 test]$ echo $LD_LIBRARY_PATH /public/soft
阅读全文
摘要:001、ldd命令 [root@PC1 src]# ldd /bin/ls linux-vdso.so.1 (0x00007ffea61ad000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f57e03d4000) libcap.so.2
阅读全文

浙公网安备 33010602011771号