Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 633
  • Last Modified:

Copy Command - Simple, but Urgent!!! EASY Points!

Hi,

I need to know how to copy all files from one folder to another folder.

The files I need to copy are all *.pl files and I need to copy them from folder 1 to folder 2.  I have tried this command but it did not work:

cp *.pl /usr/cdglobal/codex/*.pl

Can anyone help....

Cheers

G
0
GlenmoranUK
Asked:
GlenmoranUK
2 Solutions
 
sunnycoderCommented:
Hi GlenmoranUK,

> I need to know how to copy all files from one folder to another folder.

cp -R source_folder dest_folder

Sunnycoder
0
 
avizitCommented:
cp *.pl /usr/cdglobal/codex/


that should be enough
0
 
sunnycoderCommented:
GlenmoranUK,

-R option is recursive ... it wil copy all files and folder

if you want only the pl files in one flder copied,

cp source_folder/*.pl dest_folder
Sunnycoder
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ramazanyichCommented:
it should be  cp *.pl /usr/cdglobal/codex
0
 
yuzhCommented:
If you what to keep the original file permissions use tar:

cd dir1

tar cf - . | (cd /path-to/dir2; tar xvf -)



0
 
garry_mCommented:
cd /sourcefolder
for x in *; do cp $x /targetfolder; done;
0
 
garry_mCommented:
sorry, should have been:

for x in *.pl; do cp $x /targetfolder; done;
0
 
GlenmoranUKAuthor Commented:
Thanks guys,

For some reason its taken this long for the e-mail from Experts Exchange to reach me with the solutions.

Split points between avizit and sunnycoder.  Avizit game the command in the form I needed and sunny for the additional explination.

Thanks guys..

(We have had a problem with our server and our consultant is on holiday.  For some reason it crashed last night during its night jobs.  People could log in but had no access to any programs.  I found that the night job copies the user profiles (the .pl files) to a temp storage to prevent users using the programs then when the night jobs are completed it copies them back.  It never got the chance to copy them back and so they were all in this temp folder.  Hence needing the command to copy them all back..)

G
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now