在我的主文件夹中,我有多个子文件夹,每个子文件夹包含多个文件。我想合并这些文件在每个子文件夹中。合并每个文件夹中的文件(猫)Unix
所以我试图做这样的事情:
cd ../master-folder
for file in $(find . -name "*.txt");
do
cat "all the text files in this sub folder" > "name of the subfolder.txt"
rm "all the previous text files excluding the merged output obviously"
done
感谢帮助!谢谢。
附加顺序是否重要? – paul 2012-03-22 20:45:18
尝试使用-exec递归查找。它会需要一些逃避巫术,但它可能是可行的 – 2012-03-22 20:47:13
顺序并不重要。 – dawnoflife 2012-03-22 20:53:33