zoukankan      html  css  js  c++  java
  • 学习笔记之jq

    jq

    • https://stedolan.github.io/jq/
    • jq is a lightweight and flexible command-line JSON processor.
    • jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sedawkgrep and friends let you play with text.
    • jq is written in portable C, and it has zero runtime dependencies. You can download a single binary, scp it to a far away machine of the same type, and expect it to work.
    • jq can mangle the data format that you have into the one that you want with very little effort, and the program to do so is often shorter and simpler than you'd expect.
    • https://stedolan.github.io/jq/tutorial/
      • curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.'
      • curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.[0]'
      • jq '.[0] | {message: .commit.message, name: .commit.committer.name}'
      • curl 'http://...' | jq '.[] | "curl " + .url + "| jq .message > test.json"'
      • cat test.json | jq . > new.json
    • https://stedolan.github.io/jq/manual/

    How to install jq on linux system ?

    • Download jq-linux64 from jq (stedolan.github.io)
    • Put it under one directory in PATH, e.g. ~/bin
    • $ chmod +x jq-linux64
    • $ mv jq-linux64 jq
    • $ jq
    • $ echo '{"foo": 0}' | jq .
     
  • 相关阅读:
    CSS使用规则总结
    python虚拟机内存泄露?
    对象内存池
    由引擎接口自顶向下的设计引擎结构
    【译】Lesson 0: 开始学习WebGL
    【译】Lesson 1: 一个三角形和一个方块
    网盘中搭建git服务
    行为树(Behavior Tree)
    显卡参数大全
    VTune 备忘
  • 原文地址:https://www.cnblogs.com/pegasus923/p/13845186.html
Copyright © 2011-2022 走看看