copy directory structure

Dan Nelson dnelson at allantgroup.com
Wed Dec 21 12:50:11 PST 2005


In the last episode (Dec 21), Ashok Shrestha said:
> Do you know how to copy just a directory structure (not the files
> inside it)?

One way would be using mtree: 
"mtree -d -c -p /path | mtree -U -p /otherpath".  

You could also do it with find and tar:
"cd /path ; find . -type d | tar Tcfn - - | ( cd /otherpath ; tar xf - )"

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list