我想用于在终端jq
中处理我的文件。json
我正在尝试这个命令:
cat json.txt | jq 'name'
它向我展示
-bash: /usr/bin/jq: cannot execute binary file
预期结果:
Google
wherejson.txt
确实是一个有效的json
文件。我试图检查是否jq
安装正确。这是我得到的:
brew install jq
它向我展示:
Warning: jq-1.3 already installed
我正在使用mac
. 有人有什么想法吗?该json.txt
文件是:
{
"name": "Google",
"location":
{
"street": "1600 Amphitheatre Parkway",
"city": "Mountain View",
"state": "California",
"country": "US"
},
"employees":
[
{
"name": "Michael",
"division": "Engineering"
},
{
"name": "Laura",
"division": "HR"
},
{
"name": "Elise",
"division": "Marketing"
}
]
}