Skip to content

Comment on Htop 3.0parent

Comments

I love jq. Since I just learned this today, I'll mention that python comes with a JSON pretty-printing utility that can be used on the CLI:

  echo '{"some_json": "value"}' | python -m json.tool

Probably worth mentioning in this context that the pygments[1] module adds syntax coloring, as well,

  ... | python -m json.tool | python -m pygments -l json
or, path permitting,
  ... | python -m json.tool | pygmentize -l json
[1] https://pygments.org

Oh, and

  python -m http.server 12345
serves files in the current directory over HTTP on port 12345.

I'll stop now, but I love how Python module developers add these "hidden" command-line features.

P.S.: You can — and, at this point in history, probably should — s/python/python3/ in all these examples.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.