Wednesday, 17 July 2013

Linux script to display tree structure of directory

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

Output from  a folder. This displays "ONLY" directories


yum install tree

tree -A
├── resources
├── src
│   ├──
│   └── java
└── target

-A to be used if you use garbage chars as follows

âââ resources
âââ src
â   âââ
â   âââ java
âââ target


No comments:

Post a Comment