Exa install script - alternative to ls command

Moderator: Forum moderators

Post Reply
User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 88 times

Exa install script - alternative to ls command

Post by user1234 »

I found a great alternative to ls command- exa. It also gives different colours to different file types.

It is very easy to install it, but I am posting a shell script to do it (This saves one google search for you :mrgreen: :mrgreen: ).

(The main reason of this post is to bring this great command in your notice.)

Install script:

Code: Select all

#!/bin/bash

EXA_VERSION=$(curl -s "https://api.github.com/repos/ogham/exa/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
curl -Lo exa.zip "https://github.com/ogham/exa/releases/latest/download/exa-linux-x86_64-v${EXA_VERSION}.zip"
unzip -q exa.zip bin/exa -d /usr/local
Attachments
ls_vs_exa.jpg
ls_vs_exa.jpg (11.38 KiB) Viewed 621 times

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 88 times

Re: Exa install script

Post by user1234 »

I have upgraded my script a bit. It now can automatically install or upgrade itself.

Code: Select all

#!/bin/bash

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

if [ ! -f "/root/.exa_version" ] || [ $(cat "/root/.exa_version") != "$EXA_VERSION" ]; then
     echo $'Installing latest version of \e[1;34mexa\e[0;37m (v'$EXA_VERSION').....'
     curl -Lo exa.zip "https://github.com/ogham/exa/releases/latest/download/exa-linux-x86_64-v${EXA_VERSION}.zip" >/dev/null 2>/dev/null
     unzip -o -q exa.zip bin/exa -d /usr/local
     echo $EXA_VERSION > /root/.exa_version
     rm exa.zip

else echo $'\e[1;34mexa\e[0;37m already latest version.'
fi

PuppyLinux 🐾 gives new life to old computers ✨

Post Reply

Return to “File Management”