![]() |
Tree view of directory while using Subversion
Tad McClellan has on a couple of occasions posted the following shell
code as a quick way of generating a tree view of the content of a directory: find . -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g' See, for example, http://tinyurl.com/a8mmr. I've used this many times, but now that I use Subversion a lot, it generates too much output, because it prints out all the .svn directories. I hacked on Tad's suggestion and came up with this, which I've placed in my .bashrc file: # trim: A trimmer tree # bypassing all subdirectories whose names begin with '.' trim () { find . -not -regex '.*/\..*' -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g' | more } Comments? jimk |
Re: Tree view of directory while using Subversion
James E Keenan:
> # trim: A trimmer tree > # bypassing all subdirectories whose names begin with '.' > trim () > { > find . -not -regex '.*/\..*' -print | sed -e > 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g' | more > } > > Comments? No Perl involved. find . -not -name '.*' | sort | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g' | less Alternative sed-line: | sed 's,[^/]*/\([^/]*\)$,+--\1,; s,[^/]*/,| ,g' Try also: tree -C | less -R -- Affijn, Ruud "Gewoon is een tijger." |
| All times are GMT. The time now is 06:59 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.