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.

https://www.computerhope.com/unix/ucp.htm

Related posts:

Leave a Reply

Your email address will not be published.