Search Posts on Binpipe Blog

Directory Tree in Linux


If you want to get the hierarchy of the directory in a tree format there is the tree command for that. But here I have put the command in a small loop so that the output becomes more informative with the directory and file sizes also.

Try this command out in the bash shell and see the output:

#     for i in $(ls -d */); do tree  $i ; done

Note: If the directory structure is too long to caontain it in a screen you can use the following to save it to a file:

#     for i in $(ls -d */); do tree  $i ; done > result.txt

No comments:

Post a Comment

Hi, Leave a comment here and one of the binary piper's will reply soon :)