Link to home
Start Free TrialLog in
Avatar of gopikrish
gopikrish

asked on

Copying all files from one directory to another?

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.
ASKER CERTIFIED SOLUTION
Avatar of brettmjohnson
brettmjohnson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gopikrish
gopikrish

ASKER

Ok and what does the following command do?
"cp -f /home/files/myfirstscript ."
> 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.