Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 00:13
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Copy files from 1 directory to another? SOLVED
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Sat 01 Jun 2013, 11:03    Post_subject:  Copy files from 1 directory to another? SOLVED  

Hello Everyone,

I have this script that works to copy the whole directory. But what I want is to remove all the files that are in one directory and than copy what is in another to that one.

Code:

#!/bin/sh

rm -f /root/my-documents/Manna/
cp -dir /usr/local/Manna2/KJV/001genesistxt/ /root/my-documents/Manna/


Any ideas on how to do this?

Edited_time_total
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11121
Location: Arizona USA

PostPosted: Sat 01 Jun 2013, 11:32    Post_subject:  

Have you looked into rsync (rsync --help)? Perhaps one of the rsync options would be a better way to do what you want.
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sat 01 Jun 2013, 11:32    Post_subject: Copy files from 1 directory to another?
Sub_title: use *
 

Code:
# rm -f /root/my-documents/Manna/*
# cp /root/my-documents/Manna_another/*  /root/my-documents/Manna

Smile
Back to top
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Sat 01 Jun 2013, 12:17    Post_subject:  

@L18L,

Thanks that did the job-now off to do some modifications to Manna-Reader for next update Very Happy Very Happy


Cheers
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0547s ][ Queries: 12 (0.0170s) ][ GZIP on ]