Copy Home Directory

Home Sweet Home

If you want a quick 'n' easy way to copy your home directory to another disk, or just to copy a bunch of files effortlessly, use the following command:

cp -avx /home /new/path

This will copy everything in your home directory including hidden files.

It will retain file ownership and creation data.


You can also use tar to copy /home

Use the following command:

(cd /home; tar cf - .)|(cd /new_home; tar pxvf -)

This does the same as cp -a

Preserving mode, time, ownership, and other data. It also copies symlinks, hidden files and subdirs.

Thats about it!

Comments :

1
Tom Dickson-Hunt said... on 

My preferred gizmo for this is rsync, because if the copy is interrupted (which is a regrettably common occurrence with me, because I'm often copying off of old disks with bad bits that crash the machine when it hits them) it will start from where it left off, even if it was crashed ungracefully. Also, you can tell it to compress over a network stream, and it will do it.

Post a Comment