随笔分类 -  linux shell

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 78 下一页
摘要:001、从头向前,最短删除 [root@PC1 test]# var=GCF_000001735.4_TAIR10.1_genomic.fna [root@PC1 test]# echo $var GCF_000001735.4_TAIR10.1_genomic.fna [root@PC1 test 阅读全文
posted @ 2023-05-13 21:53 小鲨鱼2018 阅读(176) 评论(0) 推荐(0)
摘要:001、rename [root@PC1 test]# ls 1.csv 2.csv 3.csv a.txt b.txt c.txt [root@PC1 test]# rename ".txt" "" *.txt ## 删除.txt后缀 [root@PC1 test]# ls 1.csv 2.csv 阅读全文
posted @ 2023-05-13 21:29 小鲨鱼2018 阅读(726) 评论(0) 推荐(0)
摘要:001、型号 [root@PC1 test]# cat /proc/cpuinfo | grep name | cut -f 2 -d: | uniq -c 6 12th Gen Intel(R) Core(TM) i5-12500H 6: 总核心数 12th:12代处理器 Gen:genunie, 阅读全文
posted @ 2023-05-13 11:49 小鲨鱼2018 阅读(272) 评论(0) 推荐(0)
摘要:001、总内存 [root@PC1 test]# free -h total used free shared buff/cache available Mem: 3.7G 830M 1.8G 38M 1.1G 2.5G Swap: 3.9G 0B 3.9G 002、总硬盘 [root@PC1 te 阅读全文
posted @ 2023-05-13 11:22 小鲨鱼2018 阅读(155) 评论(0) 推荐(0)
摘要:001、 投递该任务 (base) [b20223040323@admin1 test]$ ls a.txt record.sh (base) [b20223040323@admin1 test]$ cat a.txt ## 循环配置文件 1 1000000000 2 500000000 (base 阅读全文
posted @ 2023-05-13 08:52 小鲨鱼2018 阅读(52) 评论(0) 推荐(0)
摘要:001、双引号 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 1 2 3 4 5 [root@PC1 test]# awk '{print $0, "\""}' a.txt ## 输出双引号 1 " 2 " 3 " 4 " 5 " 002、 阅读全文
posted @ 2023-05-12 16:56 小鲨鱼2018 阅读(1008) 评论(0) 推荐(0)
摘要:ubuntu中默认进入目录后默认显示的路径是完整路径。 01,将其设置为最终的路径:basename (base) root@DESKTOP-IDT9S0E:~# cp ~/.bashrc ~/.bashrc.bak ## 避免意外,备份配置文件 (base) root@DESKTOP-IDT9S0 阅读全文
posted @ 2023-05-12 11:48 小鲨鱼2018 阅读(436) 评论(0) 推荐(0)
摘要:export命令扩大了变量的作用范围。 001、 root@DESKTOP-IDT9S0E:/home/test# ls a.txt record.sh root@DESKTOP-IDT9S0E:/home/test# cat a.txt ## 测试文件 01 02 03 04 05 06 07 0 阅读全文
posted @ 2023-05-12 09:00 小鲨鱼2018 阅读(66) 评论(0) 推荐(0)
摘要:001、 root@DESKTOP-IDT9S0E:/home/test# ls a.txt b.csv c.ped xx root@DESKTOP-IDT9S0E:/home/test# cat a.txt 1 2 3 4 5 6 7 8 9 10 root@DESKTOP-IDT9S0E:/ho 阅读全文
posted @ 2023-05-12 08:52 小鲨鱼2018 阅读(32) 评论(0) 推荐(0)
摘要:001、限定匹配a3次 root@DESKTOP-IDT9S0E:/home/test# ls a.txt root@DESKTOP-IDT9S0E:/home/test# cat a.txt ## 测试数据 1 takkkkkk 2 taakkkkk 3 taaakkkk 4 33333333 5 阅读全文
posted @ 2023-05-11 10:15 小鲨鱼2018 阅读(363) 评论(0) 推荐(0)
摘要:a、 正则表达式的类型 使用正则表达式最大的问题在于有不止一种类型的正则表达式。Linux 中的不同应用程序可能会用不同类型的正则表达式。这其中包括编程语言(Java、Perl 和 Python)、Linux 实用工具(比如 sed 编辑器、gawk 程序和 grep 工具)以及主流应用(比如 My 阅读全文
posted @ 2023-05-11 09:14 小鲨鱼2018 阅读(113) 评论(0) 推荐(0)
摘要:001、大写转换为小写 root@DESKTOP-IDT9S0E:/home/test# ls a.txt root@DESKTOP-IDT9S0E:/home/test# cat a.txt ## 测试数据 AWF hhdd meh DGEE 345 efff rrt hhkk root@DESK 阅读全文
posted @ 2023-05-10 22:18 小鲨鱼2018 阅读(344) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# ls a.txt test.py [root@PC1 test]# cat a.txt ## 测试文件 1 abcd 2 abcd 3 abcd 4 abcd [root@PC1 test]# cat test.py ## 测试程序 in_file = o 阅读全文
posted @ 2023-05-10 09:20 小鲨鱼2018 阅读(356) 评论(0) 推荐(0)
摘要:001、 -i [root@PC1 test]# ls [root@PC1 test]# touch a.txt a.csv [root@PC1 test]# ls a.csv a.txt [root@PC1 test]# find ./ -name "*.txt" | xargs -i cp {} 阅读全文
posted @ 2023-05-08 21:56 小鲨鱼2018 阅读(266) 评论(0) 推荐(0)
摘要:001、不使用 -i选项 [root@PC1 test]# ls abva abvb abvc abvd dir1 dir2 dir3 dir4 dir5 [root@PC1 test]# ls | xargs mv {} {}.bak ## 不使用 -i选项 mv: cannot stat ‘{} 阅读全文
posted @ 2023-05-08 11:37 小鲨鱼2018 阅读(1572) 评论(4) 推荐(0)
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 33 ac kk dd adebc kk ad abc uy dd gg 88 [root@PC1 test]# grep -E "ab?c" a.txt ## "ab?c" 等价与 阅读全文
posted @ 2023-05-07 20:52 小鲨鱼2018 阅读(459) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test]# ls dir1 dir2 dir3 [root@PC1 test]# du -h ## 查看所有子目录占用磁盘的大小 100M ./dir1 300M ./dir2 30M ./dir3 430M . 阅读全文
posted @ 2023-05-07 20:30 小鲨鱼2018 阅读(333) 评论(0) 推荐(0)
摘要:001、 root@ubuntu01:~# cat /etc/issue Ubuntu 22.04.2 LTS \n \l 002、 root@ubuntu01:~# lsb_release -a No LSB modules are available. Distributor ID: Ubunt 阅读全文
posted @ 2023-05-07 17:16 小鲨鱼2018 阅读(267) 评论(0) 推荐(0)
摘要:source 命令会在当前 shell 中执行,而 bash 会创建一个新的 shell 会话。 001、 (base) root@DESKTOP-A31BQ38:/home/test2# ls test.sh (base) root@DESKTOP-A31BQ38:/home/test2# cat 阅读全文
posted @ 2023-05-07 00:17 小鲨鱼2018 阅读(214) 评论(0) 推荐(0)
摘要:001、 curl https://get.docker.com | sh 阅读全文
posted @ 2023-04-29 12:25 小鲨鱼2018 阅读(79) 评论(0) 推荐(0)

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 78 下一页