- Create a shell script in directory /usr/local/bin/ (You need root permission)
- Give it a name (I call it gr. )
- Edit the script (usr/local/bin/gr)to include following command using a suitable editor (such as vi ;-))
#!/bin/bash
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' - Give excutable rights
% chmod +x /usr/local/bin/gr
- Now go to any directory, (My preferred is Apache Rampart/C source) and issue
% gr
That should give you a tree view as follows..
|-core
|-data
|-handlers
|-omxmlsec
|---c14n
|---openssl
|---saml
|---tokens
|-secconv
|-trust
|-util
Thursday, February 07, 2008
Tree view in UNIX
I found this is interesting. If you like to get your directory structure in a tree view with a single command try following.
Subscribe to:
Post Comments (Atom)
1 comment:
This will do I guess,
apt-get install tree
man tree
TREE(1) TREE(1)
NAME
tree - list contents of directories in a tree-like format.
Post a Comment