随笔分类 -  linux shell

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 77 下一页
摘要:001、split实现 a、 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt ## 测试文件 01 02 03 04 05 06 07 08 09 10 11 12 [root@pc1 test1]# split -l 4 a.txt b 阅读全文
posted @ 2023-09-27 08:21 小鲨鱼2018 阅读(26) 评论(0) 推荐(0)
摘要:001、方法1, cut + 循环 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 阅读全文
posted @ 2023-09-26 00:06 小鲨鱼2018 阅读(36) 评论(0) 推荐(0)
摘要:001、grep实现 (base) [root@pc1 test2]# ls a.txt (base) [root@pc1 test2]# cat a.txt ## 测试数据 1 2 keyword 3 4 5 keyword 6 7 8 (base) [root@pc1 test2]# grep 阅读全文
posted @ 2023-09-25 22:45 小鲨鱼2018 阅读(66) 评论(0) 推荐(0)
摘要:001、方法1 (base) [root@pc1 test1]# ls a.txt (base) [root@pc1 test1]# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 keyword 16 17 18 19 20 21 22 阅读全文
posted @ 2023-09-25 10:11 小鲨鱼2018 阅读(731) 评论(0) 推荐(0)
摘要:先安装git,官网:https://git-scm.com/ 001、打开git,生成本地密钥文件 ssh-keygen ## 然后全部回车 002、查看密钥文件,id_rsa.pub C:\Users\ljx\.ssh 003、上传至服务器,并追加至authorized_keys文件(是追加) ( 阅读全文
posted @ 2023-09-22 10:28 小鲨鱼2018 阅读(1022) 评论(0) 推荐(0)
摘要:001、 [root@pc1 dir001]# ls test01 test02 ww.txt xx.map [root@pc1 dir001]# find -not -path "./test01/*" -name "*.txt" ./test02/mm.txt ./test02/dirxx/di 阅读全文
posted @ 2023-09-22 09:27 小鲨鱼2018 阅读(784) 评论(0) 推荐(0)
摘要:001、 [root@pc1 dir001]# ls test01 test02 ww.txt xx.map [root@pc1 dir001]# tree . ├── test01 │ ├── cc.csv │ └── kk.txt ├── test02 │ ├── dirxx │ │ └── d 阅读全文
posted @ 2023-09-22 09:04 小鲨鱼2018 阅读(873) 评论(0) 推荐(0)
摘要:001、-maxdepth 1 [root@pc1 dir001]# ls test01 test02 ww.txt xx.map [root@pc1 dir001]# find ./ -name "*.txt" ## 直接查找 ./test01/kk.txt ./test02/mm.txt ./t 阅读全文
posted @ 2023-09-22 09:00 小鲨鱼2018 阅读(526) 评论(0) 推荐(0)
摘要:001、不限制 [root@pc1 dir001]# ls ## 测试目录文件 test01 test02 test03 [root@pc1 dir001]# tree . ├── test01 │ ├── cc.csv │ └── kk.txt ├── test02 │ ├── mm.txt │ 阅读全文
posted @ 2023-09-22 08:53 小鲨鱼2018 阅读(129) 评论(0) 推荐(0)
摘要:001、位置锚定(开头或者结尾): ^: 表示锚定开头 $:表示锚定结尾 \<:表示匹配单词的开端 \>:表示匹配单词的结尾 \<word\>:表示匹配完整的单词 002、匹配次数1 .: 当个.表示匹配任意字符1次 ?: 表示匹配前一个字符0次或者1次 +:表示匹配前一个字符一次或者多次 *:表示 阅读全文
posted @ 2023-09-21 22:20 小鲨鱼2018 阅读(180) 评论(0) 推荐(0)
摘要:001、 ps -aux | grep "fastq-dump" 阅读全文
posted @ 2023-09-21 16:03 小鲨鱼2018 阅读(50) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test2]# ls test.sh [root@pc1 test2]# cat test.sh ## 测试程序 #!/bin/bash seq 10 > a.txt xxxxxx && echo 20 done ; rm a.txt [root@pc1 test2]# 阅读全文
posted @ 2023-09-21 11:06 小鲨鱼2018 阅读(106) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test2]# ls [root@pc1 test2]# str1="ab.cd_kk.mn_jjy" ## 测试字符串 [root@pc1 test2]# echo ${str1%%.*} ## 从左侧开始,删除.号右侧所有的内容 ab [root@pc1 test2 阅读全文
posted @ 2023-09-20 17:58 小鲨鱼2018 阅读(234) 评论(0) 推荐(0)
摘要:001、测试文件(实现仅提取==1185== 和 其他不包含==数字==的行) [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试文件 ==1185== abcadoiafa ==1120== asvgaoj fajsdfja = 阅读全文
posted @ 2023-09-20 11:59 小鲨鱼2018 阅读(85) 评论(0) 推荐(0)
摘要:[root@pc1 test2]# ls ##测试数据 a.txt b.csv c.ped test_dir [root@pc1 test2]# ls test_dir/ [root@pc1 test2]# find ./ -name "*.txt" -o -name "*.ped" -exec c 阅读全文
posted @ 2023-09-20 08:53 小鲨鱼2018 阅读(746) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test2]# ls [root@pc1 test2]# basename /home/test2/a.txt ## 仅仅获取文件 a.txt [root@pc1 test2]# dirname /home/test2/a.txt ## 仅仅获取路径 /home/tes 阅读全文
posted @ 2023-09-20 08:30 小鲨鱼2018 阅读(15) 评论(0) 推荐(0)
摘要:001、 删除最后一列 [root@pc1 test4]# ls a.txt [root@pc1 test4]# cat a.txt ## 测试文件 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 阅读全文
posted @ 2023-09-19 21:36 小鲨鱼2018 阅读(2084) 评论(0) 推荐(0)
摘要:001、 方法1 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试文件 /home/test2/a.txt [root@pc1 test2]# sed -r 's/(\/.*\/).*/\1/' a.txt ## 仅保留路径 / 阅读全文
posted @ 2023-09-19 20:22 小鲨鱼2018 阅读(122) 评论(0) 推荐(0)
摘要:对目录进行粘滞位设置,实现用户只能删除自己的文件,而不能删除别人的文件。 文件能否被删除并不取决于自身的权限,而是看其所在目录是否有写入权限。 001、 [root@pc1 home]# ls liujiaxin01 liujiaxin02 [root@pc1 home]# whoami ## 当前 阅读全文
posted @ 2023-09-18 21:53 小鲨鱼2018 阅读(62) 评论(0) 推荐(0)
摘要:setfacl(set file access control lists)设置文件访问控制列表。 文件的ACL(访问控制列表)提供的是在所有者、所属组、其他人的读、写、执行权限以外的特殊权限控制,使用setfacl命令可以针对 单一用户或用户组、单一文件或者目录来进行、读、写、执行的控制。 001 阅读全文
posted @ 2023-09-17 10:36 小鲨鱼2018 阅读(1169) 评论(0) 推荐(0)

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 77 下一页