Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

bat、shell 合并txt, 如何排除指定部分 txt 文件 ?

type *.txt>>all.txt

将目录下所有 *.txt 合并,排除 1.txt2.txt 请问这句怎么写呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. 列出全部 2. 过滤不需要的 3. 按次序输出到all.txt
    ls *.txt | grep -v '1.txt|2.txt' | xargs cat > all.txt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...