recursive concatenation

kerensa@unsw.ed

Registered
Hi,

I have a problem with concatenation text files.

I have a directory, say 'foo'
Inside this folder, I have many sub folders, say 'oof1, oof2 .... oof20'

Each oof directory has a number of text files inside it. I need to
concatenate all the text files in oof directories within foo...

I know how concatenate files using textutil -cat, however I can't seem to
get this to go recursively up and down through the oof directories. Is there a way to do this? Or a better solution?

Thanks,

Kerensa.
 
Hi Kerensa -

Try the following:

Code:
find /path/to/foo -type f -print | xargs cat > output.txt

One word of warning, don't put output.txt inside /path/to/foo or you'll keep appending it to itself until you run out of disk!
 
Back
Top