LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2007, 09:43 AM   #1
Byenary
Member
 
Registered: Oct 2003
Distribution: edgy dapper feisty
Posts: 36

Rep: Reputation: 15
copy based on date


Hello,
I need to copy some files based on date to another folder, i am able to select the files with ls instruction la -al|grep "Mar 2 1" but how do I use the result to copy it to other destinations ?
 
Old 03-02-2007, 11:42 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Have you looked at the -cmin and -ctime options to find? Find allows you to search by timeframe, and you could use the -exec option to execute the cp command.
 
Old 03-02-2007, 04:13 PM   #3
Amenemhet
LQ Newbie
 
Registered: Mar 2007
Location: canada
Distribution: fedora core 5, ubuntu 6.1
Posts: 13

Rep: Reputation: 0
Smile

Quote:
Originally Posted by Byenary
Hello,
I need to copy some files based on date to another folder, i am able to select the files with ls instruction la -al|grep "Mar 2 1" but how do I use the result to copy it to other destinations ?
If I understand you correctly, you want to copy those files elsewhere?
Just pipe them to where you want ie:
ls -la |grep "whatever" >> ~/newfile
where ~ is your home dir and then the name of the file you want
Be carefull though...using one > will change the contents of the destination file, and using two >> will add to the destination file.

Hope this helps.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CLI copy files by date linuxhippy Slackware 2 06-23-2006 09:01 PM
Filenames based on the date yilez Linux - Newbie 5 11-19-2005 10:11 PM
Copy files after a certain date davholla Linux - General 2 03-17-2005 09:29 AM
Date-based copy AdmiralThrawn Linux - General 2 02-23-2004 09:03 AM
Listing Files based on date axero Linux - Newbie 2 10-19-2003 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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