0

I would like to concatenate the following table:

A
B
C
D
E
...

I am currently using:

find "PATH" name "*.txt" -exec cat {} + >> "PATH/output.txt"

My problem is that this command concatenate from A to X; indeed I would like to concatenate from X to A. Does anyone knows how to do that? Thanks

Jacob Vlijm
  • 83,767
steve
  • 331

1 Answers1

2

Try sticking a sort in there:

find "PATH" -name "*.txt" -print0 | sort -rz | xargs -0 cat >  "PATH/output.txt"

And note that, given the same PATH, output.txt might be included in this, so the results might not be what you expected.

muru
  • 197,895
  • 55
  • 485
  • 740