随笔分类 -  linux shell

上一页 1 2 3 4 5 6 7 ··· 78 下一页
摘要:001、tr [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试文本 aa BB cc dd ee FF jj kk ll mm NN RR [root@PC1 test]# cat a.txt | tr 'a-z' 'A-Z' ## 阅读全文
posted @ 2025-08-28 14:48 小鲨鱼2018 阅读(22) 评论(0) 推荐(0)
摘要:001、Linux中同时提取文件的前几行和最后几行 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 1 2 3 4 5 6 7 8 9 10 11 12 [root@PC1 test]# cat a.txt | awk '{ay1[NR] = 阅读全文
posted @ 2025-08-12 17:31 小鲨鱼2018 阅读(18) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 01 02 03 04 05ab 06 07 08 09 10 11 12AB 13 14Ab 15 16 17 18 [root@PC1 test]# sed 's/ 阅读全文
posted @ 2025-08-08 16:46 小鲨鱼2018 阅读(28) 评论(0) 推荐(0)
摘要:001、 情形1 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 01 02 03 04 0ababab5 06 07 08 09 10 11 12 13 14 15 16 1ababab7 18 [root@PC1 test 阅读全文
posted @ 2025-08-08 12:02 小鲨鱼2018 阅读(16) 评论(0) 推荐(0)
摘要:001、 Linux中 sed -s选项 -s, --separate # 单独处理每个文件 将多个输入文件视为独立的文件流 行号计数器在每个文件重置(从1开始) 地址范围(如 1,10)应用于每个单独文件 不影响跨文件的模式空间保持(hold space) [root@PC1 test]# ls 阅读全文
posted @ 2025-08-08 11:42 小鲨鱼2018 阅读(19) 评论(0) 推荐(0)
摘要:001、 expr [root@localhost test]# expr 3 + 5 8 [root@localhost test]# expr 3 - 5 -2 [root@localhost test]# expr 3 * 5 15 [root@localhost test]# expr 3 阅读全文
posted @ 2025-07-28 21:51 小鲨鱼2018 阅读(8) 评论(0) 推荐(0)
摘要:001、 (base) [b20223040323@admin2 test5]$ ls test.ped (base) [b20223040323@admin2 test5]$ cat test.ped ## 测试ped文件 DOR DOR1 0 0 0 -9 G G C C G G G G A G 阅读全文
posted @ 2025-07-24 11:44 小鲨鱼2018 阅读(9) 评论(0) 推荐(0)
摘要:Linux 中变量字符串的截取 两类截取方式: #表示从左侧截取; %表示从右侧截取; 同时对应两种贪婪匹配模式: ##表示左侧贪婪匹配; %%表示右侧贪婪匹配; 同时对应两种方向: *.表示从左侧匹配; .*表示从右侧匹配; 001、实例1,左侧匹配截取 [root@PC1 test]# ls [ 阅读全文
posted @ 2025-07-15 09:09 小鲨鱼2018 阅读(35) 评论(0) 推荐(0)
摘要:001、 #!/usr/bin/env bash depth=9.8653 if echo "$depth > 10" | bc -l | grep -q 1 then echo "pass" else echo "fail" fi (base) [b20223040323@admin2 test] 阅读全文
posted @ 2025-07-03 09:54 小鲨鱼2018 阅读(20) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# ls hy_.txt [root@PC1 test]# cat hy_.txt ## 测试数据 Y-HA NOS453 BAJ16 SSS39 CJL300 Y-HB1 OB-060 SSS41 MG366 Y-HB2 Jaf09 NEL34RAM Y-H 阅读全文
posted @ 2025-06-10 10:20 小鲨鱼2018 阅读(11) 评论(0) 推荐(0)
摘要:001、默认查找所有文件类型 (base) [root@PC1 test]# ls a.txt dir_layer1 (base) [root@PC1 test]# tree ## 测试数据结构 . ├── a.txt └── dir_layer1 ├── a.txt └── dir_layer2 阅读全文
posted @ 2025-05-19 08:46 小鲨鱼2018 阅读(80) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# ls test [root@PC1 test]# tree -h . └── [ 32] test ├── [ 86M] a.txt └── [ 43] dir01 ├── [ 7.6M] a.txt ├── [ 7.6M] b.txt └── [ 19] 阅读全文
posted @ 2025-05-15 09:24 小鲨鱼2018 阅读(25) 评论(0) 推荐(0)
摘要:001、docker报错如下: Error response from daemon: Get "[https://registry-1.docker.io/v2/](https://registry-1.docker.io/v2/ 002、问题原因 docker镜像失效 003、修改镜像配置文件, 阅读全文
posted @ 2025-05-09 00:06 小鲨鱼2018 阅读(601) 评论(0) 推荐(0)
摘要:001、docker报错如下: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalct 阅读全文
posted @ 2025-05-09 00:00 小鲨鱼2018 阅读(726) 评论(0) 推荐(0)
摘要:001、生成测试数据 [root@PC1 test]# ls [root@PC1 test]# touch {001..100}.txt ## 生成测试数据 [root@PC1 test]# ls 001.txt 009.txt 017.txt 025.txt 033.txt 041.txt 049 阅读全文
posted @ 2025-05-08 23:10 小鲨鱼2018 阅读(32) 评论(0) 推荐(0)
摘要:001、Linux中eval命令时内建命令,其作用是会执行字符串内部的命令 [root@PC1 test]# echo "seq 5" ## seq 5写入字符串 seq 5 [root@PC1 test]# eval "seq 5" ## eval可以执行字符串内部的命令 1 2 3 4 5 。 阅读全文
posted @ 2025-05-08 22:50 小鲨鱼2018 阅读(32) 评论(0) 推荐(0)
摘要:001、查看系统信息 [root@PC1 software]# hostnamectl Static hostname: PC1 Icon name: computer-vm Chassis: vm Machine ID: 7c6deea1d66945718f62729ea78d608a Boot 阅读全文
posted @ 2025-05-08 22:41 小鲨鱼2018 阅读(47) 评论(0) 推荐(0)
摘要:001、docker报错如下: (cbbb6f6b7a37cc822450064fe49000a2415d513d9c1be1d14143cfd64a9e5c6d): Bind for 0.0.0.0:3000 failed: port is already allocated 002、解决方法: 阅读全文
posted @ 2025-05-02 22:43 小鲨鱼2018 阅读(77) 评论(0) 推荐(0)
摘要:001、 。 002、 阅读全文
posted @ 2025-05-02 18:15 小鲨鱼2018 阅读(10) 评论(0) 推荐(0)
摘要:Linux 中awk命令如何同时指定两个分割符 001、方法1 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 01_02 03 04 05 06:07 08 09@10 11 12 13 14 15_6 17 18 19 20 [root@ 阅读全文
posted @ 2025-04-24 17:57 小鲨鱼2018 阅读(34) 评论(0) 推荐(0)

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