Page 1 of 1
Exa install script - alternative to ls command
Posted: Thu Mar 03, 2022 2:06 pm
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
).
(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
Re: Exa install script
Posted: Sat Mar 05, 2022 9:12 am
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