Unix Programming - coping all files from a directory

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2006 > coping all files from a directory





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author coping all files from a directory
pawan_test

2006-07-21, 7:24 pm

Hello,

i have a directory;say /home/pavi

i has some files and every day files keep adding to it.

i am writing a shell script which copies all the files from this
directory to another.say /home/tom/tmp

how do i copy all the files from /home/pavi to /home/tom/tmp

all the files in the directory /home/tom/tmp gets automatically
deleted every 10 days.

can anyone help me plz..


thanks
pavi

Jim Cochrane

2006-07-21, 7:24 pm

On 2006-07-21, pawan_test <sridhara007@gmail.com> wrote:
> Hello,
>
> i have a directory;say /home/pavi
>
> i has some files and every day files keep adding to it.
>
> i am writing a shell script which copies all the files from this
> directory to another.say /home/tom/tmp
>
> how do i copy all the files from /home/pavi to /home/tom/tmp


two possibilities:

(cd /home/pavi; find . -print)|cpio -pdmv /home/tom/tmp
cd /home/pavi; cp -av . /home/tom/tmp


--

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com