开发者

Use bash to concatenate a list of items

开发者 https://www.devze.com 2023-04-09 08:59 出处:网络
I have a list of items like: ERR001268_chr6 ERR001312_chr6 ERR001332_chr6 ERR001361_chr6 ERR001369_chr6 ERR001413_chr6

I have a list of items like:

ERR001268_chr6  
ERR001312_chr6  
ERR001332_chr6  
ERR001361_chr6
ERR001369_chr6  
ERR001413_chr6  
ERR001433_chr6 
ERR001462_chr6  
ERR001698_chr6  
ERR001734_chr6  
ERR001763_chr6
ERR001774_chr6  
ERR001799_chr6 开发者_开发技巧 

say now I want to concatenate ERR001268_chr6 until ERR001763_chr6. I can do cat ERR001268_chr6 ERR001269_chr6....ERR001763_chr6 > xxx But obviously I don't want to type in these items one by one...So any simple bash commands to do this? thx


Assuming that the item list is the full list of 'files' under current directory:

cat `ls -1 ERR*_chr6 | head -n11` > xxx
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号