Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-01-2008, 07:21 AM   #1
Registered: Mar 2008
Posts: 58

Rep: Reputation: 15
copying directories recursively with find command

I want to construct a 'find' command which will copy only files from a directory and the subdirectories that are newer than 1 day keeping the directory structure intact. How can I do this?

Thanks in advance
Old 09-01-2008, 08:39 AM   #2
Registered: Jun 2008
Location: Toronto, Canada
Distribution: Mandriva, RHEL, Mageia, SuSE
Posts: 132

Rep: Reputation: 17
find SourceDir -type f -mtime -1 -exec cp --parents {} DestDir \;


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Telling find command to ignore directories LinuxGeek Linux - Software 10 08-17-2011 09:39 AM
Remove directories recursively with same name cboyd Linux - Newbie 5 01-14-2007 10:48 PM
chmod directories recursively mfilippa Linux - Newbie 3 04-17-2006 08:24 PM
Copying hidden files recursively? mrd Linux - General 1 09-30-2005 08:51 AM
Can ls recursively list only directories? Vosper Linux - General 3 07-16-2005 04:57 AM

All times are GMT -5. The time now is 02:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration