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 Thu 24 Apr 2014, 07:57
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 [4 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 723
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?

Last edited by oldyeller on Sat 01 Jun 2013, 12:17; edited 1 time in total
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10691
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: 2478
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Sat 01 Jun 2013, 11:32    Post subject: Copy files from 1 directory to another?
Subject description: 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: 723
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 from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0363s ][ Queries: 11 (0.0033s) ][ GZIP on ]