LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2006, 06:54 PM   #1
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
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!
 
Old 03-19-2006, 07:03 PM   #2
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
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.
 
Old 03-19-2006, 07:16 PM   #3
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
What about deleting directories? rm also has the recursive thing. If you use it or not shouldn't it delete subdirectories?
 
Old 03-19-2006, 07:26 PM   #4
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
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

Last edited by Robhogg; 03-19-2006 at 07:34 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
directory's questions codejungle Linux - Software 3 02-21-2005 04:06 PM
change file permissions recursivly without changing permission of directories eNTi Linux - Software 8 10-15-2004 03:37 PM
program/script to ftp recursivly bmeckle Linux - General 2 07-31-2004 11:38 PM
directory's owner problem limacette Slackware 1 05-26-2004 10:14 AM
cant open different directory's (NEWBIE) knoxville Linux - Newbie 2 11-28-2003 03:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration