[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Copying all files from one directory to another?

Posted on 2004-08-05
3
Medium Priority
?
291 Views
Last Modified: 2012-05-05
Suppose I am in the directory /gopi
And there are directories called as publicsource and publicdest in this /gopi directory.publicsource has some files in it whereas publicdest is empty directory.
 So how to copy all files from publicsource to publicdest from /gopi directory?
When I did,
cp -fR /gopi/publicsource /gopi/publicdest
the directory publicsource is itself getting copied to publicdest directory but i want only the files to be copied. So please help me.Thanks.
0
Comment
Question by:gopikrish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 200 total points
ID: 11731860
Try:
 cp -fR /gopi/publicsource/* /gopi/publicdest

Or
 (cd  /gopi/publicsource; tar -cf -) | (cd  /gopi/publicdest; tar -xf -)



0
 

Author Comment

by:gopikrish
ID: 11732984
Ok and what does the following command do?
"cp -f /home/files/myfirstscript ."
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 11733075
> Ok and what does the following command do?
> "cp -f /home/files/myfirstscript ."

It makes a copy of  /home/files/myfirstscript  in the current directory (.).
The copy will have the same name as the original.  The -f switch  forces
any existing file in the current directory by that name to be overwritten.

0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question