Mac OS List directory in tree view using find command.

In mac (also in a Linux systems) you will have to install an additonal package called `tree` to display the content of folder in a tree view. 

 

 

 

But what if you are like me; someone who doesn't like to install additional packages just for a simple task? Well, you are at the right place then. 

 

Here is a nice command to get that done for you. Just run the following. 

 

 find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' 


That's just it. You should see a nice tree output as shown in the above screenshot :) 

 

You could also convert this to a shell function, or an alias with a parameter to run this easily in the future.

 

Leave a comment if it helped you.


2 comments :

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi,
    Many thanks for giving this useful knowledge. This essay is excellent and really helpful.
    Thanks for the information, and good luck to those who want to take Looker Training
    Looker Training

    ReplyDelete