Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read a property value of json file located local on Ubuntu Terminal

I have a json file like below:

{
  "result": {
    "covered_percent": 47.06
  }
}

and how can I read this value on Ubuntu Terminal.

like image 602
pegatron Avatar asked Dec 27 '22 08:12

pegatron


1 Answers

As a shorter one liner you can use the following:

cat some_file.json | python -mjson.tool
like image 85
Alex Rashkov Avatar answered Dec 28 '22 20:12

Alex Rashkov