Recursively cat all the files into single file

bash, cat, grep, linux, unix

Solution

find data/ -name '*.json' -exec cat {} \; > uber.json

a short explanation:

find <where> \
  -name <file_name_pattern> \
  -exec <run_cmd_on_every_hit> {} \; \
    > <where_to_store>

Problem

I have bunch of files sitting in folders like ``` data\A\A\A\json1.json data\A\A\A\json2.json data\A\A\B\json1.json ... data\Z\Z\Z\json_x.json ``` I want to cat all the jsons into one single file?

Original source