How to modify a key's value in a JSON file from command line

前端 未结 2 1877
再見小時候
再見小時候 2020-12-15 06:06

Is it possible to change the value of a key in a JSON file from command line?

e.g., in package.json:

Change

{
    .         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 06:54

    The anoter way is to open the file itself in terminal :

    pico filename.json
    

    edit it then save then exit.

    check if correct changes were made:

    cat filename.json
    

提交回复
热议问题