linux copy directory

Some times I can’t remember how to copy the whole directory on centos, here is the code

cp -arf /home/test/*  /home2/test
#-a     Same as -dR --preserve=ALL
#-R, -r, --recursive    Copy directories recursively.
#-f    force overwrite
#-p    Same as --preserve=mode,ownership,timestamps
#-d    Same as --no-dereference --preserve=links.
#--no-dereference    Never follow symbolic links in SOURCE.

Related posts:

Leave a Reply

Your email address will not be published.