LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what does it mean to copy directory's recursivly? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-it-mean-to-copy-directorys-recursivly-426399/)

Four 03-19-2006 06:54 PM

what does it mean to copy directory's recursivly?
 
when using "cp" command what does it mean to copy directories recursivly? Also It apears to goto a link and copy everything in that link, which then it does it infinitly because the link can be found inside itself. I don't want to do that I just want the contents of a directory copied and no links. How may I do that?

Thank you!

Robhogg 03-19-2006 07:03 PM

To copy recursively means that all files within a directory will be copied, and then all files within subdirectories of that directory, and so on. If you don't want cp to follow links, then add the -d flag (do not follow symbolic links). Enter cp --help for more on this.

Rob.

Four 03-19-2006 07:16 PM

What about deleting directories? rm also has the recursive thing. If you use it or not shouldn't it delete subdirectories?

Robhogg 03-19-2006 07:26 PM

Quote:

Originally Posted by Four
What about deleting directories? rm also has the recursive thing. If you use it or not shouldn't it delete subdirectories?

Yes. Be very careful about using it. I have rm aliased to rm -i (interactive) on my PC, so that it asks before removing each file. It can be a bit annoying if you have a lot of files to remove (rm -f can be used to override this), but it can help you to avoid accidentally removing files you want to keep.

Rob


All times are GMT -5. The time now is 12:49 AM.