LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-23-2018, 12:57 PM   #1
cgardiner
LQ Newbie
 
Registered: Jul 2018
Posts: 1

Rep: Reputation: Disabled
Moving files that includes date range


I want to move multiple files from 1 directory to another using the dates. Is it possible and how can I do it.
 
Old 07-23-2018, 01:10 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,379
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
There is a program called find. There are several options to select before or after specific times. Check "man find" for the overwhelming manual page, but try to zoom in on -mtime or -newerXY. The XY are replaced with further options, for example -newerat 2018-07-18 like this:

Code:
find /some/directory -maxdepth 2 -type f -newerat 2017-07-18 \
        -not -newer 2018-07-17 -print
Take a look at a few guides and try some experiments with find then ask some specific questions.

One thing to known is that all the options have an implicit logial AND in between unless otherwise specified.

Edit: once you can find the right files then look at the -exec option for find.

Last edited by Turbocapitalist; 07-23-2018 at 01:14 PM.
 
  


Reply


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
How can search of all files in computer between range date tombett22 Programming 8 04-13-2011 07:22 PM
[SOLVED] find files in date range clcbluemont Linux - Newbie 2 05-31-2010 11:40 AM
[SOLVED] Moving files by specifying a range Ronin-8 Linux - Newbie 7 04-11-2010 12:27 AM
Zipping files by a date range nixusr Linux - Newbie 3 06-10-2008 12:14 PM
deleting by date a specific range of files nooks12 Linux - Newbie 2 01-08-2008 02:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:56 PM.

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