Jeff Abrahamson on 12 Jun 2006 17:26:17 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] printing directory tree


On Mon, Jun 12, 2006 at 12:18:27PM -0400, Art Alexion wrote:
>   [19 lines, 90 words, 690 characters]  Top characters:_ etirnao
> 
> Is there a nice way to print a tree view of a directory and its
> subdirectories (multiple pages will be needed)?
> 
> Actually, I want to print my music directory tree, so if something
> can print the tree and id3 tags, too, that would be really good.
> 
> Konqueror grays out printing in file/tree view.

I know this is now solved, but there's a simple solution that wasn't
mentioned:

    find . -type d | perl -pwe 's|[^/]+/|   |g'

Remove the "-type d" to get all files instead of just directories.
Note the obvious extension to print id3 tags by having a function as
the second element in the pipe, so that it prints the indent, the
name, and then the id3 tag if there is one.

-- 
 Jeff

 Jeff Abrahamson  <http://jeff.purple.com/>          +1 215/837-2287
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug