随笔分类 -  linux shell

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 78 下一页
摘要:001、NR [root@PC1 test02]# cat a.txt ## 测试文件 1 2 3 4 5 [root@PC1 test02]# cat b.txt ## 测试文件 11 12 13 14 15 [root@PC1 test02]# awk '{print NR, $0}' a.tx 阅读全文
posted @ 2023-08-17 17:05 小鲨鱼2018 阅读(177) 评论(0) 推荐(0)
摘要:输出is和not后面的单词 001、 [root@PC1 test01]# ls a.txt [root@PC1 test01]# cat a.txt ## 测试数据 this is wang ,not wan that is chen, not che this is chen ,and wang 阅读全文
posted @ 2023-08-07 15:17 小鲨鱼2018 阅读(539) 评论(0) 推荐(0)
摘要:以ntpd服务为例 001、查看ntpd服务的的当前状态 [root@PC1 home]# systemctl list-unit-files | grep "ntpd" ## 查看ntpd服务 ntpd.service disabled ntpdate.service disabled 002、设 阅读全文
posted @ 2023-08-04 21:54 小鲨鱼2018 阅读(507) 评论(0) 推荐(0)
摘要:001、查看ntp服务状态 [root@PC1 home]# cat /etc/redhat-release ## 系统版本 CentOS Linux release 7.6.1810 (Core) 002、启动ntp服务 [root@PC1 home]# systemctl start ntpd 阅读全文
posted @ 2023-08-04 21:42 小鲨鱼2018 阅读(634) 评论(0) 推荐(0)
摘要:001、-D选项用于限定只删除模式空间中的第一行 [root@PC1 test01]# ls data.txt [root@PC1 test01]# cat data.txt ## 测试数据 Header Line First Data Line End of Data Lines ## N选项将匹 阅读全文
posted @ 2023-08-01 09:41 小鲨鱼2018 阅读(422) 评论(0) 推荐(0)
摘要:001、-n(next),处理匹配行的下一行 [root@PC1 test01]# ls a.txt [root@PC1 test01]# cat a.txt ## 测试数据 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 [root@PC1 test01] 阅读全文
posted @ 2023-08-01 09:22 小鲨鱼2018 阅读(652) 评论(0) 推荐(0)
摘要:001、查找当前目录下的隐藏文件 [root@PC1 test01]# ls a.txt dir1 [root@PC1 test01]# ls -a . .. a.txt dir1 .x.txt [root@PC1 test01]# find ./ -maxdepth 1 -type f -name 阅读全文
posted @ 2023-07-31 17:39 小鲨鱼2018 阅读(1185) 评论(0) 推荐(0)
摘要:-h:使用易读性数字,比如 K, G单位。 001、 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 2G 3K 4K 1G [root@PC1 test02]# sort a.txt 1G 2G 3K 4K [roo 阅读全文
posted @ 2023-07-25 16:19 小鲨鱼2018 阅读(185) 评论(0) 推荐(0)
摘要:sort:-g选项:按照通用数值排序,支持科学计数法 001、直接使用sort [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 6.84017213908805e-10 6.27015779416403e-08 0.0 阅读全文
posted @ 2023-07-25 16:14 小鲨鱼2018 阅读(141) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt index.txt [root@PC1 test02]# cat index.txt ## 索引文件 2 4 8 9 14 [root@PC1 test02]# cat a.txt ## 测试文件 001 002 003 004 00 阅读全文
posted @ 2023-07-25 11:54 小鲨鱼2018 阅读(81) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test04]# ls account adr [root@PC1 test04]# cat account ## 测试数据 张三|000001 李四|000002 [root@PC1 test04]# cat adr ## 测试数据 000001|10 000001| 阅读全文
posted @ 2023-07-25 11:45 小鲨鱼2018 阅读(124) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 a 5 a 6 a 8 b 1 b 2 b 3 b 8 c 2 c 7 ## 输出第一列中各标签对应值的平均值 [root@PC1 test02]# awk ' 阅读全文
posted @ 2023-07-25 00:26 小鲨鱼2018 阅读(34) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 3 21971 22579 21 9 46 3 21976 22553 38 118 45 3 21972 22609 44 9 47 3 21987 2253 阅读全文
posted @ 2023-07-24 21:41 小鲨鱼2018 阅读(119) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 20 10 40 30 60 50 80 70 01 90 21 11 41 31 61 51 81 71 02 91 22 12 42 32 62 52 82 阅读全文
posted @ 2023-07-24 00:04 小鲨鱼2018 阅读(63) 评论(0) 推荐(0)
摘要:linux中 mkpasswd命令用于生成密码。 001、问题bash: mkpasswd: command not found... [root@PC1 test02]# mkpasswd bash: mkpasswd: command not found... 002、解决方法 [root@PC 阅读全文
posted @ 2023-07-23 23:53 小鲨鱼2018 阅读(289) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 0102030405 0607080910 1112131415 [root@PC1 test02]# fold -w 2 a.txt ## 以两个字符为单位进 阅读全文
posted @ 2023-07-23 23:26 小鲨鱼2018 阅读(42) 评论(0) 推荐(0)
摘要:001、-d表示删除 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 a f k jH f k E 3j s 8 8 34 a j F ej [root@PC1 test02]# cat a.txt | tr -d 0 阅读全文
posted @ 2023-07-23 23:13 小鲨鱼2018 阅读(1921) 评论(0) 推荐(0)
摘要:001、列 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 3 6 2 8 2 5 8 4 1 3 8 2 ## 统计每列数据之和 [root@PC1 test02]# awk '{for(i = 1; i <= NF 阅读全文
posted @ 2023-07-23 22:07 小鲨鱼2018 阅读(346) 评论(0) 推荐(0)
摘要:001、问题 linux 终端 ctrl + c无法终止当前程序 002、解决方法 01、ctrl + z: 让程序后台运行 02、找到该进程 03、kill -9 该进程名称或者号码 参考:https://blog.csdn.net/m0_67401382/article/details/1264 阅读全文
posted @ 2023-07-23 12:07 小鲨鱼2018 阅读(2191) 评论(0) 推荐(0)
摘要:001、$RANDOM; $RANDOM用于生成0—32767的随机数 [root@PC1 test05]# echo $RANDOM 21160 [root@PC1 test05]# echo $RANDOM 17006 [root@PC1 test05]# echo $RANDOM 3979 0 阅读全文
posted @ 2023-07-22 15:46 小鲨鱼2018 阅读(780) 评论(0) 推荐(0)

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 78 下一页