Display a text tree of subdirectories in Mac OS X

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

As an alternative - instead of typing this gigantic line every time - add an alias to yor profile:

vi ~/.profile

Include the following line:

alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"

Next time you type tree in the command line, a text subdirectory tree will be displayed.

|-------Source-English (US)
|-------Target-Chinese (Simplified)
|-------Target-Chinese (Traditional)
|-------Target-English (United Kingdom)
|-------Target-French (Canada)
|-------Target-French (France)
|-------Target-German (Germany)
|-------Target-Italian (Italy)
|-------Target-Malay (Malaysia)
|-------Target-Portuguese (Brazil)
|-------Target-Portuguese (Portugal)
|-------Target-Spanish (Spain)

Note: If you have Homebrew install tree:

brew install tree