I want to concatenate multiple files from different directories.
Directory 1: Chr1
containing (in this example) four files:
ABC.1
DEF.1
GHI.1
JKL.1
Directory 2: Chr2
ABC.2
DEF.2
GHI.2
JKL.2
There are 22 directories. Each file has 20 columns with a header. The headers are the same for all files.
I want to concatenate all into one file (one global output file for the concatenation of all files from all directories).
I tried this but this does not work.
cat */Chr{1..22}/*.{1..22} > */final_file
It said that "No such file or directory", as there are no files, for example, for *.1~21 for the files in the directory of chr22.
Do you have any ideas? Thank you in advance.