Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-09-2004, 12:58 PM   #1
Registered: Aug 2003
Posts: 232

Rep: Reputation: 30
copy content of the folder

sorry, this question may be too easy for many gurus in here but I need help:

1. how can I copy all of the folder named A to the folder B????
cp -R A B???

2. on vi, how can I replace a word to something else, also replace all???

Old 01-09-2004, 01:05 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
1) Copy:
cp -r /path/to/A /path/to/B

2) Open the document in vi then type:
Old 01-09-2004, 01:07 PM   #3
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
−R, −r, −−recursive
copy directories recursively
from cp man page ... it will copy the whole directory tree, subdirectorys and all...
so ---> cp -r /here /to/here

as of vi ....

replace the with The but will ask before substituting.

will search the entire file and replace the with The.

Last edited by DrOzz; 01-09-2004 at 01:08 PM.
Old 01-09-2004, 01:12 PM   #4
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
If I use:

cp -r /path/to/A /path/to/B

later on the B directory I am going to have:


I don't want to have the A folder on B:

I just want something like

/path/to/B/whatever the content in A directory.

Old 01-09-2004, 01:59 PM   #5
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
How about using cpio?

cd /DirectoryA
find . -depth | cpio --pass-through \
--preserve-modification-time \
--make-directories --verbose /DirectoryB
Old 04-16-2007, 10:43 AM   #6
LQ Newbie
Registered: Apr 2007
Distribution: slackware
Posts: 6

Rep: Reputation: 0
copy content from dir to another dir

being in the dir that you want to copy the content type : cp -rui /source path/* /destination path

-r=recursive (also copies all the sub dir's)
-u=updates any older files newer are being left alone
-i=prompt when overrides
*=wildcard (for files with extensions that would be *.*

being sort of a dead subject i hope i could be of help
Old 04-16-2007, 10:50 AM   #7
Senior Member
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Originally Posted by ashley75
If I use:

cp -r /path/to/A /path/to/B

later on the B directory I am going to have:

cp -r /path/to/A/* /path/to/B/


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy content between 2 web sites jim656 Linux - Networking 5 11-08-2005 10:11 AM
How to copy the content of a DVD into several CDs? anindyanuri Linux - Software 2 06-13-2005 08:05 AM
copy a content of screen while X windows system is being loaded fuelinux Linux - Newbie 2 10-24-2003 06:36 AM
how do i copy a folder to a newly installed hd dsiguy Linux - General 2 09-24-2003 01:25 PM
How to copy a selected content from a .PDF file satimis Linux - General 3 07-03-2003 04:18 AM > Forums > Linux Forums > Linux - General

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

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