$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' ExplanationThis one-liner initially does a recursive listing of the current directory: Any output other that the directory names, identified by Finally there's a little of LimitationsWorks for me with Bash under Linux, Mac OS X, Solaris. |