The tree command has been around in Windows for a very long time to print out the directory structure but this is still not available in most of the Unix variants. Most of the new Linux distributions do seem to have the tree command available.
If the tree command is not available, you may try to run the following one-liner to simulate the tree command.
1 |
$ find ./ -type d | awk -F "/" '{ ld=0x2500; lt=0x251c; ll=0x2502; for (i=1; i<=NF-2; i++){printf "%c ",ll} printf "%c%c %s\n",lt,ld,$NF }' |
If the directories are being printed out without the lines appearing in the above command, try the alternative command below.
1 |
$ find ./ -type d | awk -F "/" '{ ld="-"; lt="+"; ll="|"; for (i=1; i<=NF-2; i++){printf "%c ",ll} printf "%c%c %s\n",lt,ld,$NF }' |
The output may not give the exact directory structure output as the native tree command, but it does get the job done.