随笔分类 - linux shell
摘要:001、判断一组依次递增的数据 [root@PC1 test2]# cat a.txt ## 测试数据 3 4 5 6 7 8 9 [root@PC1 test2]# awk 'BEGIN{temp = 0} { if(NR > 1 && ($1 - temp) != 1) {print NR,"x
阅读全文
摘要:001、查看一下当前系统 [root@PC1 home]# hostnamectl Static hostname: PC1 Icon name: computer Chassis: n/a Machine ID: 8f7f58c7ef6f42489c3251e9f474be72 Boot ID:
阅读全文
摘要:001、 [root@PC1 test]# df -h ## 查看各个挂载点的大小 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 46G 4.3G 42G 10% / devtmpfs 1.9G 0 1.9G 0%
阅读全文
摘要:001、ls + sed + awk实现 root@PC1:/home/req/input/E.coli/fastq# ls SRR1770413_1.fastq.gz SRR1770413_2.fastq.gz root@PC1:/home/req/input/E.coli/fastq# ls |
阅读全文
摘要:001、wc -c 命令: 统计字符数 root@PC1:/home/req/input/test# ls a.txt root@PC1:/home/req/input/test# cat a.txt ## 测试文件 aa bb cc dd ee ff root@PC1:/home/req/inpu
阅读全文
摘要:001、 root@PC1:/home/test3# ls root@PC1:/home/test3# seq 1000 > a.txt ## 生成一个测试文件 root@PC1:/home/test3# ls a.txt root@PC1:/home/test3# sha1sum a.txt ##
阅读全文
摘要:001、测试1 root@PC1:/home/test# ls ## 3个测试文件 a.txt b.txt c.txt root@PC1:/home/test# cat a.txt a j 6 b d j root@PC1:/home/test# cat b.txt 3 7 k j x v root
阅读全文
摘要:001、 root@PC1:/home/test# ls ## 3个测试文件 a.txt b.txt c.txt root@PC1:/home/test# cat a.txt a j 6 b d j root@PC1:/home/test# cat b.txt 3 7 k j x v root@PC
阅读全文
摘要:001、查看系统 [root@PC1 test]# hostnamectl Static hostname: PC1 Icon name: computer Chassis: n/a Machine ID: 1739a8a8e564458e93c6b2f64619a348 Boot ID: b1cc
阅读全文
摘要:001、问题 root@PC1:/home/test3# ping www.baidu.com ping: www.baidu.com: Temporary failure in name resolution 002、解决方法(修改DNS服务配置文件) vim /etc/resolv.conf #
阅读全文
摘要:001、 free -h 002、 cat /proc/meminfo
阅读全文
摘要:001、 设置高亮显示:set hlsearch 取消高亮显示:set nosearch 002、 忽略大小写:set ignorecase
阅读全文
摘要:001、 (base) root@PC1:/home/test3# ls (base) root@PC1:/home/test3# echo "xx" xx (base) root@PC1:/home/test3# echo -n "xx" ## echo -n 实现输出字符串,但是不输出换行符 x
阅读全文
摘要:001、 (base) root@PC1:/home/test3# ls a.txt (base) root@PC1:/home/test3# cat a.txt ## 测试数据 1 aa 2 bb 3 aa 4 cc 5 dd 6 cc 7 kk 8 aa 9 kk ## 根据第二列的重复项筛选数
阅读全文
摘要:001、删除第一列 (base) root@PC1:/home/test# cat test.txt 1 MIR1302-10 1 2 FAM138A 2 3 OR4F5 3 4 RP11-34P13.7 4 5 RP11-34P13.8 5 6 AL627309.1 6 7 RP11-34P13.
阅读全文
摘要:001、 (base) root@PC1:/home/test4# ls a.txt (base) root@PC1:/home/test4# cat a.txt ## 测试数据 ##1 ##2 ##3 4 i 6 y #kk mm a 9 7 6 (base) root@PC1:/home/tes
阅读全文
摘要:001、n (base) root@PC1:/home/test4# ls a.txt (base) root@PC1:/home/test4# cat a.txt 1 2 3 4 5 (base) root@PC1:/home/test4# sed 'n;p' a.txt ## n的作用是将两行作
阅读全文
摘要:001: p:输出缓冲区中的所有内容。 P:输出缓冲区中一个个换行符之前的内容 (base) root@PC1:/home/test4# ls a.txt (base) root@PC1:/home/test4# cat a.txt 1 2 3 4 5 ## N的作用是预先读取下一行,将两行作为一行
阅读全文
摘要:001、 (base) root@PC1:/home/test4# ls a.txt (base) root@PC1:/home/test4# cat a.txt 1 2 3 4 34aaaa 5 6 7 aaaa 8 9 10 (base) root@PC1:/home/test4# sed '$
阅读全文
摘要:001、 (base) root@PC1:/home/test4# cat a.txt 1 2 3 4 34aaaa 5 6 7 aaaa 8 9 10 (base) root@PC1:/home/test4# sed -e:b -e '$!{N;1,1bb' -e\} -e '/\n.*aaa/!
阅读全文

浙公网安备 33010602011771号