[plug] Command drama

Timothy White weirdit at gmail.com
Mon Nov 20 13:11:18 WST 2006


On 11/20/06, Gavin Chester <sales at ecosolutions.com.au> wrote:
> On Mon, 2006-11-20 at 11:19 +0800, Gavin Chester wrote:
> > On Mon, 2006-11-20 at 10:37 +0800, garry wrote:
> > > Can anyone help me?
> > >
> > > I've been trying to copy just a directory structure, without the files..
> >
> > Short and sweet, just type 'tree' and copy and paste output from
> > terminal ;-)
>
> Ooops, hit send too soon, that should have been 'tree -d' - couldn't be
> easier than all that grep, awk, etc stuff ;-)

'tree -dfin' will give you much better usage.
'find -type d' will give you hidden directorys, although I'm sure you
can make tree do that as well.

So for find, you would use -exec or something, for tree, something
like the following...

for dir in `tree -dfin`; do mkdir -p /new_top_dir/$dir; done

Hope that helps

Tim
-- 
Linux Counter user #273956
Don't email joeblogs at scouts.org.au



More information about the plug mailing list