Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How to Pretty Print JSON file in Linux Shell Script

    How to Pretty Print JSON file in Linux Shell Script

    RahulBy RahulMay 22, 20191 Min ReadUpdated:June 5, 2019

    The json_pp is a command line utility available in Linux systems to print JSON output in pretty format. It can format the JSON content in file or results of other commands by passing with the pipe.

    For example, I have a file fruit.json conaiting some json content but not in proper format.

    cat fruit.json
    
    {"fruit": "Apple", "size": "Large","color": "Red"}
    

    Now, send the json content to the json_pp command via the pipe. You will find the results in a pretty format, which can be easily read.

    cat myfile.json | json_pp
    

    Output:

    {
       "color" : "Red",
       "fruit" : "Apple",
       "size" : "Large"
    }
    
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Disable Directory Listing in Apache
    Next Article Download MX Linux 18.03 – DVD ISO Images

    Related Posts

    How to Install Sublime Text 4 on Ubuntu 22.04

    2 Mins Read

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    (Resolved) – ReactJS 404 Error on Page Reload

    2 Mins Read

    Adding a New SSH Key in GitHub

    Updated:April 1, 20223 Mins Read

    13 Best Linux Terminal Emulators and Bash Editors

    8 Mins Read

    How To Install Oracle VirtualBox on Debian 11

    2 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.