DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

How to Pretty Print JSON File in Linux Terminal

4 years ago itsfoss.com
How to Pretty Print JSON File in Linux Terminal

Summary: This is a summary of an article originally published by the source. Read the full original article here →

However, reading the JSON file can be a pain if the JSON file is minified.

Even a human can still read it but if JSON file is properly formatted to display the content, it will be much easier.

With universe repository enabled, you can install it on Ubuntu using the apt command: Once you have it installed, use it in the following manner to pretty print JSON file on the display: You may also tempt to use cat but I believe it one of the useless use of cat command.

If you want to modify the original JSON file with pretty print format, you can pipe the parsed output to a new file and then copy it to the original JSON file.

If that’s the case, you can use it pretty print the JSON file in the terminal: I know there are other ways to parse JSON file and print it with proper format.

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com