怎样在Linux服务器里复制整个文件目录

Linux这几天一直在用SSH登录到网页服务器安装、调试WordPress 2.3和WordPress Mu。不免要移动、复制文件。但自己老是记不住怎样复制整个文件夹的那个简单命令。就算记住了,每次试了几次才能搞对。

好了,为了提醒和方便自己,这次特意写进博客。

一般来说,先进入要被拷入的目录,然后再用cp命令会简单多了。这个困惑我的简单命令就是:

cp -R ~/source-directory-name .

这里, ~/source-directory-name 就是你要复制的源文件夹。不要忘了命令最后那个句号点 (.), 这个点代表要拷入的目前目录。当然,如果你不是先进入该目录,则你就要将被拷入的文件目录名写全了。

英文原帖: how to copy directory in linux with cp command

2 Responses to “怎样在Linux服务器里复制整个文件目录”

  1. Lien Shaffner

    I synced my iPhone and lost all of my notes!!! How or can I recover them. The only back up files listed in iTunes were the ones I did after losing my notes and trying to recover them. I deleted them like you suggested, hoping it would revert back to an old back-up but nothing is there now. Back-up files is blank. I am not using a Mac or Vista that was mentioned in this information.

    [Reply]

  2. Whitney Losier

    Thanks GerryR! I’m new to blogging and finally emailed Dennis. I’ve spent most of my time on this site since my confirmed atr. My doctor wouldn’t give me a date when i could put weight on my foot- I kept asking when can i wear a boot and start driving?!!!! The doc wrote on my paperwork- 10-12 weeks non weight bearing (i’m thinkin they were cushioning it) i can’t wait to start the blog! Were you the one doing exercises on the wheelchair? Thanks for the advices : )

    [Reply]

Leave a Reply

Your email address will not be published. Required fields are marked *