随笔分类 -  linux shell

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 78 下一页
摘要:001、 a.txt [root@pc1 test01]# cat a.txt ## 测试数据 40 60 20 40 40 80 60 20 20 89 ## 每隔3行, 打上标签 [root@pc1 test01]# awk 'BEGIN{a=1}{if(sum <= 3) {print "ta 阅读全文
posted @ 2023-10-06 10:54 小鲨鱼2018 阅读(55) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 40 60 20 40 40 80 60 20 20 0 0 80 4 4 8 8 ## 每隔4行输出平均值 [root@pc1 test01]# awk '{ 阅读全文
posted @ 2023-10-06 10:45 小鲨鱼2018 阅读(94) 评论(0) 推荐(0)
摘要:001、问题,centos7中中用户名和主机名消失,显示-bash-4.2,如下: -bash-4.2$ 002、产生原因 配置文件丢失或意外删除。 003、解决方法1 -bash-4.2$ echo "export PS1='[\u@\h \W]\$'" >> ~/.bash_profile -b 阅读全文
posted @ 2023-10-05 14:00 小鲨鱼2018 阅读(812) 评论(1) 推荐(0)
摘要:001、 创建两个测试用户 [root@pc1 home]# ls [root@pc1 home]# useradd user01 ## 创建两个测试用户 [root@pc1 home]# useradd user02 [root@pc1 home]# echo tmppasswd | passwd 阅读全文
posted @ 2023-10-04 16:33 小鲨鱼2018 阅读(578) 评论(0) 推荐(0)
摘要:001、 (base) [root@pc1 test]# ls (base) [root@pc1 test]# echo $a ## 测试变量a和b (base) [root@pc1 test]# echo $b (base) [root@pc1 test]# export a=10000 ## a 阅读全文
posted @ 2023-10-02 00:01 小鲨鱼2018 阅读(23) 评论(0) 推荐(0)
摘要:001、tr -dc string: 表示删除字符以外(补集complement)的所有字符 [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt ## 测试文本 01 02 abd ef 03jkk. 04, f 05 f 06 [root@pc 阅读全文
posted @ 2023-10-01 23:16 小鲨鱼2018 阅读(385) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test]# ls ## 测试文件 a.txt b.txt [root@pc1 test]# ll -h total 110M -rw-r--r--. 1 root root 10M Oct 1 22:13 a.txt -rw-r--r--. 1 root root 1 阅读全文
posted @ 2023-10-01 22:25 小鲨鱼2018 阅读(65) 评论(0) 推荐(0)
摘要:001、tr实现 a、 [root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试文件 01 02 03 04 05 06 07 08 09 10 [root@pc1 test02]# cat a.txt | tr "\n" " " 阅读全文
posted @ 2023-09-30 21:50 小鲨鱼2018 阅读(935) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test]# echo -n ! | od -A n -t u1 ## 将ASCII码感叹号转换为十进制数值 33 002、 [root@pc1 test]# echo -n ! | od -A n ## 将ASCII感叹号转换为8进制数值 000041 003、 [r 阅读全文
posted @ 2023-09-30 20:52 小鲨鱼2018 阅读(217) 评论(0) 推荐(0)
摘要:001、磁盘占用 (base) [root@pc1 test1]# ls test1 test2 test3 (base) [root@pc1 test1]# find $PWD -type d ## 查出所有目录 /home/test1 /home/test1/test1 /home/test1/ 阅读全文
posted @ 2023-09-27 21:55 小鲨鱼2018 阅读(59) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt batch01 xyz1 batch02 xyz2 batch03 xyz3 batch04 xyz4 batch05 xyz5 [root@pc1 test2]# awk '{s 阅读全文
posted @ 2023-09-27 09:03 小鲨鱼2018 阅读(418) 评论(0) 推荐(0)
摘要: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 阅读(33) 评论(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 阅读(43) 评论(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 阅读(76) 评论(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 阅读(743) 评论(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 阅读(1035) 评论(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 阅读(798) 评论(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 阅读(890) 评论(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 阅读(541) 评论(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 阅读(135) 评论(0) 推荐(0)

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 78 下一页