linux下输出json字符串,用python格式化

echo '{"name":"chen","age":"11"}' |python -m json.tool

如果是文件,用cat打印,如{"name":"chen","age":"11"}存在一个文件test中

用cat test |python -m json.tool

原文地址:https://www.cnblogs.com/endtel/p/9408997.html