List folders with icons with this Go cli

🚀 Another interesting application made in Go.


List folders with icons with this Go cli


gtree is a command similar to the tree command that works on any operating system, written in Go and that displays file icons.


Installation

First you need to have the Go programming language installed on your system, examples of how to install Go:

Windows(with WinGet in PowerShell):

winget install -e --id GoLang.Go.1.19

macOS(with Brew):

brew install go

Ubuntu(with APT):

sudo apt install golang-go

Also install the Terminal Root Fonts so that the icons are displayed correctly.


Now just clone the repository and run the commands below:

git clone https://github.com/kitagry/gtree
cd gtree
go get github.com/kitagry/gtree
go build .

And move it to a folder on your system, for example:

Example on UNIX-like systems.

sudo install -v gtree /usr/local/bin/

It’s good to remove the files and folders made to build, example:

cd ..
rm -rf gtree/
sudo rm -rf go/

And test:

gtree --version
gtree .

IMPORTANT TIP: Avoid using the trailing slash, example: Instead of:

gtree mydir/

Use it like this:

gtree mydir

It doesn’t display the files in the folders when there is a slash/ at the end.

For more information, access the repository on GitHub and use the help: gtree --help.


See also:

Install an ls that shows file icons


go cli command


Share


YouTube channel

Subscribe


Marcos Oliveira

Marcos Oliveira

Software developer
https://github.com/terroo

Related articles