随笔分类 -  linux shell

上一页 1 2 3 4 5 6 7 8 9 ··· 78 下一页
摘要:001、 [root@localhost test]# ls a.txt [root@localhost test]# cat a.txt ## 测试数据 00_3 8834 1b_kk ffaa 55_f3_34 8834 aa_bb_kk_44 44aa [root@localhost test 阅读全文
posted @ 2025-03-15 01:05 小鲨鱼2018 阅读(28) 评论(0) 推荐(0)
摘要:001、linux shell中如何实现矩阵文件按照某一列的指定顺序排序 [s20213040583@admin2 test]$ ls a.txt idx.txt [s20213040583@admin2 test]$ cat a.txt ## 测试数据 d 100 888 c 666 999 a 阅读全文
posted @ 2025-03-13 15:15 小鲨鱼2018 阅读(17) 评论(0) 推荐(0)
摘要:001、Linux 中 如何区分文本使用空格还是制表符分割 [root@PC1 test]# ls a.txt b.txt [root@PC1 test]# cat a.txt ## 测试数据 空格分割 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 阅读全文
posted @ 2025-03-13 11:43 小鲨鱼2018 阅读(33) 评论(0) 推荐(0)
摘要:001、实例如下: (base) [b20223040323@admin2 test]$ ls a.txt (base) [b20223040323@admin2 test]$ cat a.txt ## 测试数据, 第一列又两类重复 aa 11 bb 89 aa 77 kk 66 aa 88 kk 阅读全文
posted @ 2025-03-11 16:13 小鲨鱼2018 阅读(69) 评论(0) 推荐(0)
摘要:001、删除第9个字段gene_id前边的所有内容 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试数据 NC_089035.1 Gnomon transcript 7328 15219 阅读全文
posted @ 2025-03-11 11:26 小鲨鱼2018 阅读(61) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# echo ${array1[*]} 100 aaa xxxYYY [root@PC1 test]# echo ${array1[@]} 100 aaa xxxYYY [root@PC1 test]# echo ${!array1[@]} 0 1 2 [ro 阅读全文
posted @ 2025-03-08 20:40 小鲨鱼2018 阅读(25) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# ls a.sh [root@PC1 test]# cat a.sh #!/bin/bash echo hello world [root@PC1 test]# sh -c bash a.sh ## 更新了系统环境变量? (base) [root@PC1 t 阅读全文
posted @ 2025-03-08 10:22 小鲨鱼2018 阅读(54) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试数据 W-URI-20 W-HYB-21 aaa fff-ddd-eee ZOM-1 ZOM-9 AWA-A-1 AWA-A-6 [root@PC1 test2]# se 阅读全文
posted @ 2025-03-06 09:10 小鲨鱼2018 阅读(18) 评论(0) 推荐(0)
摘要:Linux 中sed命令的整行替换. 001、基本用法 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试文件 a UU i a UU i b q j c q y [root@PC1 test2]# sed '/b/ s/.*/Q 阅读全文
posted @ 2025-02-24 17:08 小鲨鱼2018 阅读(121) 评论(0) 推荐(0)
摘要:001、 Linuxbash和source命令的区别在于,当你用bash命令执行脚本时,它告诉Linux内核创建一个新的Bash进程来读取和执行脚本,将输出复制到原先的shell进程中,并显示下来. 然而source命令是一个外置的shell,它读取和评估当前shell进程中的文件。为此,脚本所做的 阅读全文
posted @ 2025-02-23 18:11 小鲨鱼2018 阅读(85) 评论(0) 推荐(0)
摘要:001、 创建数组 a、 declare -a array1 。 b、 array1[0]=100 。 002、删除数组 unset array1 。 003、查看数组 a、查看数组所有的元素: [root@PC1 test]# array1[0]=100 [root@PC1 test]# arra 阅读全文
posted @ 2025-02-23 15:58 小鲨鱼2018 阅读(25) 评论(0) 推荐(0)
摘要:001、关联数组的声明 declare -A array1 002、关联数组的赋值 [root@localhost test]# declare -A array1 [root@localhost test]# array1["a"]=1000 [root@localhost test]# arra 阅读全文
posted @ 2025-02-23 15:58 小鲨鱼2018 阅读(13) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2025-02-22 20:02 小鲨鱼2018 阅读(47) 评论(0) 推荐(0)
摘要:001、 Linux 中export命令 阅读全文
posted @ 2025-02-22 18:56 小鲨鱼2018 阅读(8) 评论(0) 推荐(0)
摘要: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行的测试数 阅读全文
posted @ 2025-02-22 18:05 小鲨鱼2018 阅读(26) 评论(0) 推荐(0)
摘要:Linux shell中如何一次迭代传入多个变量 阅读全文
posted @ 2025-02-21 09:11 小鲨鱼2018 阅读(11) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2025-02-20 10:55 小鲨鱼2018 阅读(18) 评论(0) 推荐(0)
摘要:Linux中grep命令实现带有通配符.关键字符的精准匹配 001、 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试文件 new_seq KRA6 Karakaya new_seq ss 阅读全文
posted @ 2025-02-17 19:05 小鲨鱼2018 阅读(48) 评论(0) 推荐(0)
摘要:001、 Linux 中 awk正则匹配屏蔽原始字符串 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试文件 0M6 FKDN240280192-1A 0.51 Fail 0M7 FKDN 阅读全文
posted @ 2025-02-17 10:29 小鲨鱼2018 阅读(10) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2025-02-16 20:10 小鲨鱼2018 阅读(16) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 ··· 78 下一页