• 2023-05-12linux 中 export命令
     export命令扩大了变量的作用范围。001、root@DESKTOP-IDT9S0E:/home/test#lsa.txtrecord.shroot@DESKTOP-IDT9S0E:/home/test#cata.txt##测试文件010203040506070809101112root@DESKTOP-IDT9S0E:/home/test#catrecord.sh##测试命令#!/b
  • 2023-05-12linux 中xargs 命令
     001、root@DESKTOP-IDT9S0E:/home/test#lsa.txtb.csvc.pedxxroot@DESKTOP-IDT9S0E:/home/test#cata.txt12345678910root@DESKTOP-IDT9S0E:/home/test#echoa.txt|cata.txtroot@DESKTOP-IDT9S0E:/home/test#echoa.txt|xargscat
  • 2023-05-11linux 中 正则表达式* 和 ?
     *表示匹配前一个字符0次或者多次;?表示匹配前一个字符0次或者1次,且只在扩展正则表达式中生效。 001、root@DESKTOP-IDT9S0E:/home/test#echo"ik"|grep"ie?k"root@DESKTOP-IDT9S0E:/home/test#echo"ik"|sed-n'/ie*k/p'##*表示匹配0次或者多次ikroot@DESK
  • 2023-05-10linux 中sed命令实现大小写的转换
     001、大写转换为小写root@DESKTOP-IDT9S0E:/home/test#lsa.txtroot@DESKTOP-IDT9S0E:/home/test#cata.txt##测试数据AWFhhddmehDGEE345efffrrthhkkroot@DESKTOP-IDT9S0E:/home/test#sed's/[a-z]/\U&/g'a.txt##U为大写AWFH
  • 2023-04-26linux 中 批量提取指定的列
     001、(py38)root@DESKTOP-IDT9S0E:/home/test#lsa.txtindex.txtrecord.sh(py38)root@DESKTOP-IDT9S0E:/home/test#cata.txt##测试数据0102030405060708091011121314151617181920212223242526272829303132333435363
  • 2023-04-25linux 中 批量删除指定的行
     001、(py38)root@DESKTOP-IDT9S0E:/home/test#cata.txt##测试数据01020304050607(py38)root@DESKTOP-IDT9S0E:/home/test#catindex.txt##计划批量删除的行号247(py38)root@DESKTOP-IDT9S0E:/home/test#foriin$(catindex.txt);dosed-i"$i
  • 2023-04-15linux中截取字符串中指定字符之前的内容
     001、root@DESKTOP-IDT9S0E:/home/test/test/test#str1="Homo_sapiens.GRCh38.99.chgffromosome.22.gff3"root@DESKTOP-IDT9S0E:/home/test/test/test#str2=${str1%.*}##截取最后一个.之前的内容root@DESKTOP-IDT9S0E:/home/test/test/test#echo$str2Homo_sapiens
  • 2023-04-15linux中dirname 和 basename命令
     001、dirname用于从绝对路径中剥离出路径002、basename用于从绝对路径中剥离出文件名 测试:root@DESKTOP-IDT9S0E:~#lsroot@DESKTOP-IDT9S0E:~#dirname/home/test2/a.sh##dirname剥离出路径/home/test2root@DESKTOP-IDT9S0E:~#basename/home/test2/a.sh##b