随笔分类 - linux shell
摘要:001、 -a 表示而且 [root@PC1 test]# a=5 [root@PC1 test]# b=10 [root@PC1 test]# if [ $a -gt 0 -a $b -gt 0 ]; then echo "yes"; fi ## -a表示逻辑而且,只有两边同时满足时才返回真 ye
阅读全文
摘要:001、 [root@PC1 test]# a=10 [root@PC1 test]# echo $a 10 [root@PC1 test]# echo $b [root@PC1 test]# [ -z $a ] ## 如果变量没有被赋值,则返回真,否则返回假 [root@PC1 test]# ec
阅读全文
摘要:001、 [root@PC1 test]# ls [root@PC1 test]# touch a.txt ## 测试文件 [root@PC1 test]# seq 6 > b.txt ## 测试文件 [root@PC1 test]# cat a.txt [root@PC1 test]# cat b
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a bc k bc e bc bc bc 3 44 55 60 bc bc kk uu [root@PC1 test]# rev a.txt | sed 's/cb/Q
阅读全文
摘要:001、 删除匹配字符之后的若干行 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 9 10 [root@PC1 test]# sed '/5/,+1{/5/b;d}' a.txt ## 删除匹
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 [root@PC1 test]# sed '/4/{n;d}' a.txt ## 删除匹配4的下一行 1 2 3 4 6 7 8 002
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 4 5 6 [root@PC1 test]# awk '{printf("%s ", $0)} END {printf"\n"}' a.txt 1 2 3
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt d t d e k c z c e e f t [root@PC1 test]# sed 's/d/9/g' a.txt ## 将d替换为9 9 t 9 e k c z c e e f
阅读全文
摘要:001、 删除a.txt中每一列中=号后面的所有内容 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 AC=2 AF=1.00 AN=2 DP=131 AC=2 AF=1.00 AN=2 DP=152 AC=2 AF=1.00
阅读全文
摘要:001、 [root@PC1 test]# start=`date +%s` ## 从 1970 年 1 月 1 日 00:00:00 UTC 到目前为止的秒数(时间戳) [root@PC1 test]# echo $start 1670412402 [root@PC1 test]# end=`da
阅读全文
摘要:001、压缩保留源文件 [root@PC1 test]# ls a.txt [root@PC1 test]# gzip -c a.txt > a.txt.gz ## 压缩并保留源文件 [root@PC1 test]# ls a.txt a.txt.gz 002、解压缩保留源文件 [root@PC1
阅读全文
摘要:001、通过比较MD5码 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 1 2 5 3 4 6 7 [root@PC1 test]# sort -n a.txt | md5sum ## 排序并生成MD5码 77c58f04583c86f78
阅读全文
摘要:001、 [root@pc1 test4]# ls test.fa [root@pc1 test4]# cat test.fa ## 测试fasta文件 >mmm 11111 >bbb 888888 7777 >kkk 6666666 99999 >qqq 0000 33333 [root@pc1
阅读全文
摘要:001、 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt 3 5 3 aa 3 3 4 3 3 aa 8 8 8 [root@pc1 test1]# awk '{a=($0 ~ "aa"); print a}' a.txt ## 匹配成功
阅读全文
摘要:001、以bp显示 [root@PC1 test]# ls a.map [root@PC1 test]# ls -l total 1228800 -rw-r--r--. 1 root root 1258291200 Dec 1 20:03 a.map 002、 以适当单位显示 [root@PC1 t
阅读全文
摘要:001、 [root@PC1 test]# ls a.map a.ped a.txt b.ped b.txt [root@PC1 test]# ll -h total 1.4G -rw-r--r--. 1 root root 200M Dec 1 19:42 a.map -rw-r--r--. 1
阅读全文
摘要:第一个是 release版本,里面包含了源码,和Demo代码,比较大。后两个是源码,不含Demo。后面两个压缩方式格式不同,.zip格式用于windowstar.gz 格式多用于 Unix/linux MacOS 系统。 来源:https://zhidao.baidu.com/question/13
阅读全文
摘要:001、问题:rar: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by rar) 002、问题原因(缺乏动态库文件) /lib64/libstdc++.so.6: version `GLIBCXX_3.4.
阅读全文
摘要:001、 strings /usr/lib64/libstdc++.so.6 | grep GLIBC
阅读全文
摘要:001、测试命令 [root@pc1 test3]# rar bash: rar: command not found... 002、查看系统 [root@pc1 test3]# ls [root@pc1 test3]# cat /etc/redhat-release CentOS Linux re
阅读全文

浙公网安备 33010602011771号