..

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.

|---Projects
|-----264035_Sample_Project
|-------Source-English (US)
|-------Target-Arabic
|-------Target-Catalan
|-------Target-Chinese (Simplified)
|-------Target-Chinese (Traditional)
|-------Target-Croatian
|-------Target-Czech
|-------Target-Danish
|-------Target-Dutch
|-------Target-English (United Kingdom)
|-------Target-Finnish
|-------Target-French (Canada)
|-------Target-French (France)
|-------Target-German (Germany)
|-------Target-Greek
|-------Target-Hebrew
|-------Target-Hindi
|-------Target-Hungarian
|-------Target-Indonesian
|-------Target-Italian (Italy)
|-------Target-Japanese
|-------Target-Korean
|-------Target-Malay (Malaysia)
|-------Target-Norwegian
|-------Target-Polish
|-------Target-Portuguese (Brazil)
|-------Target-Portuguese (Portugal)
|-------Target-Romanian
|-------Target-Russian
|-------Target-Slovak
|-------Target-Spanish (Spain)
|-------Target-Swedish
|-------Target-Thai
|-------Target-Turkish
|-------Target-Ukrainian
|-------Target-Vietnamese

Note: If you have Homebrew install tree:

brew install tree