Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy files

Status
Not open for further replies.

lintow

Programmer
Nov 29, 2004
82
US
I want to create a script to copy files from on directory to another.

Question is: I have a file or files that start with phpdird_111 and phpdird_122 and so on.. I could have 20 to 30 files like this with the begining name
(phpdird_and any number)

So I want to copy all the file that start with phpdird

How can this be done....I guess its like a (like value) or something like that.

any help would be apprecaited
 
cp phpdird* /your/destination/directory

-------------------------
The trouble with doing something right the first time is that noboby appreciates how difficult it was.
- Steven Wright
 
cp -pv phpdird_* /path/to/target/.

-p: preserve owner
-v: verbose

Cheers.
 
how would I copy them from my unix box to a windows pc from the script.
 
you can use samba in order to mount some shared folder from the windows in your unix and copy as posted:

mount -t smbfs //ip_host_windows/shared_folder /mnt

then cp files /mnt/.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top