Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-23-2006, 08:26 PM   #1
Senior Member
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,190

Rep: Reputation: 47
CLI copy files by date

I've done this before in another OS and hope I can do it in Linux. I just downloaded a bunch of files that I want to copy to my USB pendrive-how do I only copy those files with cp by specifying the date? I read the man page and cannot find that option.
Old 06-23-2006, 08:51 PM   #2
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31
For what I understand of your problem, I'd use find along with cp.

something like

$ find . -ctime -7 -exec cp {} /path/to/destiny \;
This should copy files with data modified in the last 7 days (you can specify minutes instead of days with -cmin n, and you can use access time instead with -atime. You can compare with an existing file with -cnewer <file>).

I'd recomemend you to read man find.

Also, I'm pretty sure there are several other ways of doing this.

Last edited by theoffset; 06-23-2006 at 08:54 PM.
Old 06-23-2006, 09:01 PM   #3
Registered: Oct 2003
Location: Richmond, Virginia USA
Distribution: Slackware 12.2
Posts: 59

Rep: Reputation: 15
Something like this

cd to source directory, then:

mkdir catch; cp -ra $( ls -l | awk '$6~/2006-01-*/ { print $8 }' ) catch
where catch directory is where you want files to end up.


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
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-07-2013 11:34 PM
CLI copy is greater than GUI copy ?? 0_o killahsmurf Slackware 14 01-04-2006 11:53 AM
Copy files after a certain date davholla Linux - General 2 03-17-2005 09:29 AM
CLI copy & paste between text files? David the H. Linux - General 3 09-15-2004 12:05 PM
How can I copy a directory and it's contents with CLI? CyberLord_7 Linux - General 2 03-30-2004 11:35 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:39 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