{"authors":["utzer"],"canonical_url":"https://newblog.utzer.de/2023/07/11/linux-cp-command-with-reflink/","categories":["Linux"],"content":"```\ncp -pRv --reflink=auto /source/folder /destination/folder\n```\n\ncopy files and directories  \n-p same as --preserve=mode,ownership,timestamps  \n-R, -r, --recursive  \ncopy directories recursively  \n-v verbose, show what is going on.\n\n--reflink\\[=WHEN\\]  \ncontrol clone/CoW copies.\n\nThis just copied 169GB of files in 20 seconds. This only works on supported filesystems, so for example by \"#Btrfs, #CIFS, #NFS 4.2, #OCFS2, #overlayfs, and #XFS\". See [here](https://unix.stackexchange.com/a/631238).\n\nExplainshell tells you [this](https://explainshell.com/explain?cmd=cp+-pRv+--reflink%3Dauto+%2Fsource%2Ffolder%2Ffile+%2Fdestination%2Ffolder%2Ffile).\n","content_format":"markdown","date":"2023-07-11T09:36:53Z","description":"``` cp -pRv --reflink=auto /source/folder /destination/folder ``` copy files and directories -p same as --preserve=mode,ownership,timestamps -R, -r, --recursive copy directories recursively -v verbose, show what is going on. --reflink\\[=WHEN\\] control clone/CoW copies. This just copied 169GB of file","html_url":"https://newblog.utzer.de/2023/07/11/linux-cp-command-with-reflink/","json_url":"https://newblog.utzer.de/2023/07/11/linux-cp-command-with-reflink/index.json","lastmod":"2023-07-11T09:36:53Z","markdown_url":"https://newblog.utzer.de/2023/07/11/linux-cp-command-with-reflink/index.md","media":[],"schema_version":1,"tags":["BTRFS","CIFS","copy","cp","linux","NFS","XFS"],"title":"Linux cp command with reflink","type":"blog_post"}