Many people know the problem: You have to find something, but you’re having no idea where to find it. Of course, you can use „locate“ or „find“ and search for the file. But what’s the best possibility for getting an overview about directories, files, binaries or subdirectories?
YES – it’s using the „tree“ command. But what are you going to do, if you’re working on a managed server without any root-access and without the possibility to install tree?
Here’s a short solution for this problem:
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'