背景:一个文件是dict,但是内容未格式化展示,阅读起来非常困难
解决:使用python -m json.tool
即可解决
示例:cat xxx| python -m json.tool
具体示例如下:
$cat test_json
{"a":"b","c":"daakkfff","cdfga":"cvghss"}
$cat test_json | python -m json.tool
{
"a": "b",
"c": "daakkfff",
"cdfga": "cvghss"
}