I found this bash command that creates a directory tree in your console window. I find it quite useful, but I don't really understand how all of the special characters work. Could someone help break it down for me?
alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
The first two are pretty simple to understand, this is creating an alias in bash that recursively lists the files and folders beneath the current directory.
1. alias tree="" 2. ls -R
But after those I'm pretty much lost. I get that it's piping the rest of the commands through grep and sed, but I don't understand the rest of it or even what these modifiers are called.