随笔分类 - linux shell
摘要:001、测试文件 [root@PC1 test2]# ls a.txt b.txt [root@PC1 test2]# cat a.txt ## 测试文件 a b k c j [root@PC1 test2]# cat b.txt ## 测试文件 a x b y c 002、输出两个文件合并后的唯一
阅读全文
摘要:001、pscp命令的目录,在安装putty的目录,如下图: 002、在pscp目录下打开cmd命令: 鼠标放置任意空白处,按住shift键,然后鼠标右击弹出对话框,选择在此处打开powershell选项。 弹出如下界面: 003、实现windows到linux中传输文件 pscp C:/Users
阅读全文
摘要:001、 [root@PC1 test]# ls test.txt [root@PC1 test]# cat test.txt ## 测试数据 Abpink Jnzoar Bizxar Abcd [root@PC1 test]# cat -A test.txt ## 第三行出现特殊字符B-BM- A
阅读全文
摘要:1、 [root@PC1 home]# echo "unalias rm mv cp" >> ~/.bashrc ## 在root家目录中.bashrc配置文件后追加取消别名命令 [root@PC1 home]# source ~/.bashrc ## 使配置文件生效
阅读全文
摘要:001、-O选项, 指定输出的文件名 [root@PC1 test]# wget -O download.file https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos5/sra-pub-zq-11/SRR001/770/SRR1770413/SRR177
阅读全文
摘要:001、 [root@PC1 test]# ls SraRunInfo (2).csv [root@PC1 test]# mv SraRunInfo (2).csv new_name ## 复制文件名重命名报错 -bash: syntax error near unexpected token `(
阅读全文
摘要:001、 [root@PC1 test]# ls ## 测试数据 SraRunInfo(1).csv SraRunInfo(2).csv SraRunInfo(3).csv SraRunInfo(4).csv SraRunInfo(5).csv SraRunInfo.csv [root@PC1 te
阅读全文
摘要:001、 [root@PC1 test]# ls a b c d.txt x y.txt [root@PC1 test]# ll -h ## 测试数据,两个文件名中都有空格 total 8.0K -rw-r--r--. 1 root root 9 Dec 31 20:56 a b c d.txt -
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a b c d x x k a d k k [root@PC1 test]# awk '{print gsub("k", "&")}' a.txt ## 统计每一行的k
阅读全文
摘要:001、 [root@PC1 test]# ls [root@PC1 test]# touch test{1..12} ## 创建测试数据 [root@PC1 test]# ls test1 test10 test11 test12 test2 test3 test4 test5 test6 tes
阅读全文
摘要:001、 [root@PC1 test4]# ls a.txt coordinate.txt [root@PC1 test4]# cat a.txt ## 测试数据 dd ff sd 1 ss aa ee 2 xx vv zz 3 ss ww rr 4 aa ff jj 5 nn mm kk 6 s
阅读全文
摘要:001、 [root@PC1 test]# ls coordinate.txt [root@PC1 test]# cat coordinate.txt ## 测试数据 3 MMM 5 GGG 8 QQQ [root@PC1 test]# awk '{if(NR == 1) {print $1 -1,
阅读全文
摘要:001、 sed 实现 [root@PC1 test4]# ls a.txt coordinate.txt [root@PC1 test4]# cat a.txt ## 测试数据 dd ff sd 1 ss aa ee 2 xx vv zz 3 ss ww rr 4 aa ff jj 5 nn mm
阅读全文
摘要:001、 [liujiaxin01@PC1 test]$ ls a.txt [liujiaxin01@PC1 test]$ cat a.txt ## 测试数据 ## xxx yy ## ddd ss ## kkk qqq ## mm nn 1 a A 7 2 b B 6 3 c C 5 4 d D
阅读全文
摘要:001、 [liujiaxin01@PC1 test]$ ls a.txt [liujiaxin01@PC1 test]$ cat a.txt ## xxx yy ## ddd ss ## kkk qqq ## mm nn 1 a A 7 2 b B 6 3 c C 5 4 d D 4 [liuji
阅读全文
摘要:001、 [liujiaxin01@PC1 test]$ ls a.txt [liujiaxin01@PC1 test]$ cat a.txt ## 测试数据 1 a A 7 2 b B 6 3 c C 5 4 d D 4 5 e E 3 6 f F 2 7 g G 1 [liujiaxin01@P
阅读全文
摘要:001、 [liujiaxin01@PC1 test]$ ls a.txt b.txt [liujiaxin01@PC1 test]$ echo {a..e} ## 输出a-e的字母序列 a b c d e [liujiaxin01@PC1 test]$ echo {a..e} | tr " " "
阅读全文
摘要:001、 [root@pc1 test]# ls [root@pc1 test]# var=mnopqrst ## 测试变量 [root@pc1 test]# echo $var ## 打印出该变量 mnopqrst [root@pc1 test]# echo ${var%qrst} ## 利用{}
阅读全文
摘要:001、 [root@pc1 test3]# ls a.txt [root@pc1 test3]# cat a.txt ## 测试数据 a b c a b c a b c [root@pc1 test3]# sed '1,6 /a/d' a.txt ## 删除1-6行中,匹配a的行, 发现报错 se
阅读全文
摘要:001、 [root@pc1 test1]# start=$(date +%s) ## 记录程序的开始时间 [root@pc1 test1]# echo $start 1671529118 [root@pc1 test1]# end=$(date +%s) ## 记录程序的结束时间 [root@pc
阅读全文