Oleg Goldshmidt wrote:
> 
> Antti Hakulinen <[EMAIL PROTECTED]> writes:
> 
> > Hi there.
> > I'm a C language newbie and i'm not cabable of doing one program on my own
> > yet, so care to point the best "What you personally think as..." site to me
> > about learing C language.
> > Mostly i am interested in time functions etc etc...
> >
> > I would like to construct a little program that moves files of certain date
> > from one directory to another.
> > For example, a program that would move all files to another directory which
> > are two days older than the current date...
> > Any examples anywhere??
> 
> Well, this mailing list deals with Linux, not C. Try comp.lang.c
> instead, or comp.unix.programmer if your question is UNIX-specific.
> 
> However, the Linux answer to your question (assuming you need to do
> that on Linux or another UNIX-like system) is the find command. Look
> up the documentation ("man find", "info find") and you'll do what you
> need without writing a single line in C.
> 
...snip...
Hi

This ;

find /path/to/search/from -ctime +30 -exec mv {} /path/to/move/files/to
\;

Will locate all files/directories older than 30 days from
/path/to/search/from
and the sub directories under it and move them {directories and all} to
the
directory /path/to/move/files/to . If the directory /path/to/search/from
contains only files then just files will be moved.

I use this type of command fairly regularly. Reading the man page will
helpful.
There are many options for the find command for instance adding "-type
f" to the
command will restrict the query to "regular files" only.


Guy



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to