I have n files that are generated by a system and they will be named 'file1 file 2 file3 file4' etc. I need to concatenate these files into one file called result. The problem is that i need the data in the file4 to be at the top and the data in file1 to be at the bottom etc. (ps file4 will not always be the highest file , it could go all the way to file999)
I tried doing this
ls file* | sort -r | cat > result
but this just gives me a file with a list of the file names and not the concatenated data.
Somebody mentioned that I might need to use xargs at some point but was unable to tell me how
Any help on this would be greatly appreciated
I tried doing this
ls file* | sort -r | cat > result
but this just gives me a file with a list of the file names and not the concatenated data.
Somebody mentioned that I might need to use xargs at some point but was unable to tell me how
Any help on this would be greatly appreciated