The erdtree is a command line tool designed for displaying directory trees in a more visual and user-friendly manner. It offers a more readable and colorful alternative to traditional tools like tree
. This tutorial explains how to install erdtree on Ubuntu 24.04.
Install erdtree
Execute the following command to retrieve the latest version tag of the erdtree release and save it in a variable:
ERDTREE_VERSION=$(curl -s "https://api.github.com/repos/solidiquis/erdtree/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
Download the tar.gz
file from the releases page of the erdtree repository:
wget -qO erdtree.tar.gz https://github.com/solidiquis/erdtree/releases/latest/download/erd-v$ERDTREE_VERSION-x86_64-unknown-linux-gnu.tar.gz
Extract executable to /usr/local/bin
directory:
sudo tar xf erdtree.tar.gz -C /usr/local/bin erd
We can verify the erdtree version in the following manner:
erd --version
Remove unneeded file:
rm -rf erdtree.tar.gz
Testing erdtree
Use the following erd
command to display a directory tree of the current directory, showing only the top level and including hidden files:
erd --level 1 --hidden
To display the directory tree of a specific directory, supply the directory path as an argument. For example, to examine the /usr/local
directory, use this command:
erd --level 1 --hidden /usr/local
Uninstall erdtree
To uninstall erdtree, remove the related file:
sudo rm -rf /usr/local/bin/erd
Leave a Comment
Cancel reply