I wanted to install the tree command to look at /var/www. I can ls /var/www and the directories it contains. Permissions on those directories are set to 755.
I ran
sudo snap install tree
thereafter running
tree /var/www
returns the message
/var/www [error opening dir]
I removed the tree snap with
sudo snap remove --purge tree
...and installed tree with
sudo apt install tree
Now when I try to use tree I get
-bash: /snap/bin/tree: No such file or directory
How to I banish the snap version of tree from my machine completely?
hash -d tree
orhash -r
to clear the whole table - see for example Why is my system only looking in /snap for binaries? – steeldriver Mar 18 '21 at 00:01