Install jless on Ubuntu 24.04

Install jless on Ubuntu 24.04

The jless is a command line tool designed to view and navigate JSON data efficiently. It is particularly useful for working with large JSON files or API responses, providing a more user-friendly and interactive experience compared to traditional command line utilities. This tutorial demonstrates how to install jless on Ubuntu 24.04.

Install jless

Fetch the latest version of jless from its official GitHub repository:

JLESS_VERSION=$(curl -s "https://api.github.com/repos/PaulJuliusMartinez/jless/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Run the following command to download archive:

sudo wget -qO /usr/local/bin/jless.gz https://github.com/PaulJuliusMartinez/jless/releases/latest/download/jless-v$JLESS_VERSION-x86_64-unknown-linux-gnu.zip

Execute the following command to extract the executable from the archive:

sudo gunzip /usr/local/bin/jless.gz

Set execute permission:

sudo chmod a+x /usr/local/bin/jless

To verify the version of jless, run command:

jless --version

Testing jless

Create a test.json file:

echo '{"status":"success","data":[{"name":"John","age":25},{"name":"James","age":29}]}' > test.json

To view JSON files, run the jless command followed by the path to the JSON file. For example:

jless test.json

Once the file is open in jless, you can navigate through the JSON structure using arrow keys, page up/down keys, or the mouse wheel. Use the arrow keys to expand or collapse objects and arrays.

View JSON using jless on Ubuntu

Uninstall jless

To remove jless, delete the associated file:

sudo rm -rf /usr/local/bin/jless

Leave a Comment

Cancel reply

Your email address will not be published.