How to compress json file



For a single file use this:

 jq -c . all_json_words.json > minify_words.json


to use it in a for loop

for file in *.json; do
    jq -c . "$file" > "${file%.json}.min.json"
done
Share:

0 Comments:

Post a Comment