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 .
     
  • 相关阅读:
    vue.js
    kendo ui DatePicker 时区转换
    List Except 失效 差集失效
    RabbitMQ的安装
    net core 使用 Redis
    SQLSERVER学习八:事务和锁
    SQLSERVER学习七:存储过程
    SQLSERVER学习六:函数
    SQLSERVER学习五:流程控制语句
    SQLSERVER学习四:常用检索语句
  • 原文地址:https://www.cnblogs.com/pegasus923/p/13845186.html
Copyright © 2011-2022 走看看