Safely Copy Directories in Unix

August 18, 2005

I use this a lot when I need/want to mount a new partition into a directory location that I have been previously been using (i.e. Vinum configuration in FreeBSD). What’s great for me is that it will copy file permissions over properly – and better yet, if it fails partway through you don’t lose any data.
# mkdir newdir
# cd olddir
# tar -cf - . | ( cd newdir && tar -xf - )

Make The Call

Get Started

Use this if you’re making an IT decision and want to avoid a costly mistake. Answer four quick questions and we’ll route you to the right next step—strategy, sourcing, contract review, or optimization.

If it’s a fit, you’ll be able to book time immediately.

By continuing, you agree to be contacted about your request. No spam.