selecting files by date

Johannes Franken jfranken at jfranken.de
Sat Dec 10 19:05:39 UTC 2005


* shaunak saha <reach2shaunak at gmail.com> [2005-12-07 05:31 +0100]:
> In my current directory i have edited almost 90 files yesterday.I want to
> send all these files to a separate directory.Do i have to write a shell
> script for these or can I do by a single command using pipe.I have tried it
> using pipe. I have used ls -l then grep and then cut.By doing these I am
> getting the name of the files.What to do next?

find . -mtime -NUMBEROFDAYSAGO -exec cp -p "{}" TARGETDIRECTORY/ \;

check the selection with
find . -mtime -NUMBEROFDAYSAGO -ls
first.


-- 
Johannes Franken
 
Professional unix/network development
mailto:jfranken at jfranken.de
http://www.jfranken.de/




More information about the redhat-list mailing list