随笔分类 - linux shell
摘要: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
阅读全文
摘要: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 '{
阅读全文
摘要:001、问题,centos7中中用户名和主机名消失,显示-bash-4.2,如下: -bash-4.2$ 002、产生原因 配置文件丢失或意外删除。 003、解决方法1 -bash-4.2$ echo "export PS1='[\u@\h \W]\$'" >> ~/.bash_profile -b
阅读全文
摘要:001、 创建两个测试用户 [root@pc1 home]# ls [root@pc1 home]# useradd user01 ## 创建两个测试用户 [root@pc1 home]# useradd user02 [root@pc1 home]# echo tmppasswd | passwd
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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" " "
阅读全文
摘要: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
阅读全文
摘要:001、磁盘占用 (base) [root@pc1 test1]# ls test1 test2 test3 (base) [root@pc1 test1]# find $PWD -type d ## 查出所有目录 /home/test1 /home/test1/test1 /home/test1/
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:先安装git,官网:https://git-scm.com/ 001、打开git,生成本地密钥文件 ssh-keygen ## 然后全部回车 002、查看密钥文件,id_rsa.pub C:\Users\ljx\.ssh 003、上传至服务器,并追加至authorized_keys文件(是追加) (
阅读全文
摘要: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
阅读全文
摘要:001、 [root@pc1 dir001]# ls test01 test02 ww.txt xx.map [root@pc1 dir001]# tree . ├── test01 │ ├── cc.csv │ └── kk.txt ├── test02 │ ├── dirxx │ │ └── d
阅读全文
摘要: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
阅读全文
摘要:001、不限制 [root@pc1 dir001]# ls ## 测试目录文件 test01 test02 test03 [root@pc1 dir001]# tree . ├── test01 │ ├── cc.csv │ └── kk.txt ├── test02 │ ├── mm.txt │
阅读全文

浙公网安备 33010602011771号