Sample Header Ad - 728x90

How to concatenate files in reverse order

1 vote
3 answers
659 views
I am looking to concatenate a list of files in a directory in the reverse order that they appear in the list. This is different from tac as tac will concatenate the files with reversed line order. Basically I have a folder with 3 files, file1, file2 and file3. cat f* > newfile will merge these files like so: file1 file2 file3 However, I want to merge the files like this file3 file2 file1 whilst maintaining the correct line order.
Asked by sarahParker (11 rep)
Apr 26, 2022, 05:26 PM
Last activity: Apr 26, 2022, 06:38 PM