随笔分类 - linux shell
摘要:001、q,表示退出(匹配地址后退出sed脚本) [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 22 jj yy ss ff xx zz vv bb dd 00 ss 99 cc mm bb tt yy [root@PC1
阅读全文
摘要:001、指定列的输入分隔符 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt aa:bb:cc 11:22:33 55:88:33 [root@PC1 test]# awk -F ":" '{print $2}' a.txt ## 使用-F 选
阅读全文
摘要:001、 ctrl + a: 将光标移动到命令行的开头,相当于键盘中的home键 002、 ctrl + e: 将光标移动到命令行的结尾,相当于键盘中的end键 003、ctrl + u: 剪切光标所在位置之前的内容 004、ctrl + k: 剪切光标所在位置之后的内容 005、ctrl + y:
阅读全文
摘要:001、普通数组 普通数组的定义: ay=(100 200 300 "aa" "bb") ## 直接定义 [root@PC1 test]# ay2[0]=800 ## 单独定义每一个元素 [root@PC1 test]# ay2[1]="aaaa" [root@PC1 test]# ay2[2]=5
阅读全文
摘要:001、 [root@PC1 test]# ls test.sh [root@PC1 test]# cat test.sh ## 测试脚本 #!/bin/bash read -p "please input an character:" key ## 给变量key赋值 case $key in ##
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a b c 3 d b e 7 a d e 8 z b c 4 a d e 1 [root@PC1 test]# awk '{array[$2] += $4} END
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bb kk aa qq kk 11 kk dd kk mm xx [root@PC1 test]# cat -A a.txt ## 可以看到有tab制表符 aa^
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bb cc dd 11 22 33 [root@PC1 test]# cat -A a.txt ## cat -A , tab键显示为^I aa bb^Icc^I
阅读全文
摘要:001、 [b20223040323@admin1 test]$ ls test.fa [b20223040323@admin1 test]$ cat test.fa ## 测试数据 >chr1 aabbccdd eeff >chr2 xxyyzzqq gg >chr3 ddjjiill ssff
阅读全文
摘要:001、 root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# cat a.txt ## 测试数据 2,7 3.23 72 3!8\34 34+3 444 root@ubuntu01:/home/test# awk '{print
阅读全文
摘要:001、 利用awk语句判断 root@ubuntu01:/home/test# ls a.txt b.txt root@ubuntu01:/home/test# cat a.txt 1 2 3 4 root@ubuntu01:/home/test# cat b.txt 1 1 1 1 root@u
阅读全文
摘要:001、https://www.cnblogs.com/yukina/p/16821631.html
阅读全文
摘要:001、首先找到vim的安装目录,这里是: /public/home/b20223040323/software/vim_dir/share/vim/vim90 002、对defaults.vim文件进行编辑 在末尾增加 :set mouse=r echo "set mouse=r" >> defa
阅读全文
摘要:001、 [b20223040323@admin1 test]$ ls a.txt [b20223040323@admin1 test]$ cat a.txt ## 测试数据 d_j j k d d_kk [b20223040323@admin1 test]$ cat a.txt | while r
阅读全文
摘要:001、卸载旧版本vim [root@PC1 home]# yum remove vim* -y 002、 下载安装包 wget https://github.com/vim/vim/archive/refs/tags/v9.0.1313.zip 003、解压。。。。安装 yum install g
阅读全文
摘要:001、 打开vim的配置文件:vim ~/.vimrc 然后在其末尾增加如下内容, 然后保存退出: if has("autocmd") filetype indent on autocmd FileType * setlocal ts=4 sts=4 sw=4 ai et nu autocmd F
阅读全文
摘要:001、问题 vim 进入插入模式后,按退格键无法删除: 002、解决方法 echo "set backspace=2" >> ~/.vimrc ## 启用退格键的删除功能 003、 测试,没有问题
阅读全文
摘要:因为grep是支持正则表达式的,[ ] ,这两个左右括号,可能属于非法匹配。 -F选项使正则匹配失效? 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 1359 kkkk 1[36]0 qqqq 1361 jjjj
阅读全文
摘要:grep中的-x选项表示当前行只存在匹配项时才输出。 001、 [b20223040323@admin1 test]$ ls a.txt [b20223040323@admin1 test]$ cat a.txt ## 测试数据 ID3-A CCNYL1-B COQ10B-A ID3 DLD-1 [
阅读全文
摘要:001、/tmp在根目录/下挂载,因此/tmp的可用容量实际就是根目录/的可用容量。 [root@PC1 liujiaxin02]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 50G 5.6G 4
阅读全文

浙公网安备 33010602011771号