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? 1

Status
Not open for further replies.

mikeboz

MIS
May 18, 2000
41
US
I would like to copy all files in a directory structure, into one level.

example::
dira contains dirb dirc file1 file2 file3
dirb contains dird file4 file5
dirc contains file6 file7
dird file8 file9


some copy command:
blah blah blah

results:
/tmp contains file1-file9
 
Hi Mikeboz,

If it is just the files that you want, you could use the find command, something like this

for file in `find dira -depth -type f`
do
move $file /tmp
done

Hope this is of some help

Regards
Queenie


 
I new it was an easy one.

Never did know what to make of -depth.

thanks, that did it.

mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top