How to list files within date range at cli [duplicate]

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This question already has an answer here:
How to list files that were changed in a certain range of time?
5 answers
Can one pls tell a proper to list files within date range on cli. Say between Feb 20 to Mar 2 then mv these files to another dir.
Thanks
linux files timestamps
marked as duplicate by don_crissti, Jeff Schaller, Timothy Martin, G-Man, DarkHeart Mar 7 at 7:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
This question already has an answer here:
How to list files that were changed in a certain range of time?
5 answers
Can one pls tell a proper to list files within date range on cli. Say between Feb 20 to Mar 2 then mv these files to another dir.
Thanks
linux files timestamps
marked as duplicate by don_crissti, Jeff Schaller, Timothy Martin, G-Man, DarkHeart Mar 7 at 7:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
How to list files that were changed in a certain range of time?
5 answers
Can one pls tell a proper to list files within date range on cli. Say between Feb 20 to Mar 2 then mv these files to another dir.
Thanks
linux files timestamps
This question already has an answer here:
How to list files that were changed in a certain range of time?
5 answers
Can one pls tell a proper to list files within date range on cli. Say between Feb 20 to Mar 2 then mv these files to another dir.
Thanks
This question already has an answer here:
How to list files that were changed in a certain range of time?
5 answers
linux files timestamps
edited Mar 6 at 19:33
don_crissti
46.4k15123153
46.4k15123153
asked Mar 6 at 19:26
Frank
1
1
marked as duplicate by don_crissti, Jeff Schaller, Timothy Martin, G-Man, DarkHeart Mar 7 at 7:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by don_crissti, Jeff Schaller, Timothy Martin, G-Man, DarkHeart Mar 7 at 7:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
For find implementations that does not have -newerct (older GNU find and find on BSD systems):
Create two timestamp files and use find to find all files that are newer than the oldest of these and older than the newest:
touch -d 2018-02-20T00:00:00 ts-start
touch -d 2018-03-03T00:00:00 ts-end
find . -type f -newer ts-start ! -newer ts-end ! -name ts-end -exec mv /destination ';'
rm -f ts-start ts-end
We have to exclude the ts-end filename as that file fulfills the criteria.
add a comment |Â
up vote
0
down vote
find -newerct "20 Feb 2018" ! -newerct "2 Mar 2018" -exec mv /path/to/target/dir
This uses features introduced in recent versions of GNU find.
There are plenty of other ways to accomplish the same thing with find. See the man page for information about -newerxy, -mtime
and other goodies.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
For find implementations that does not have -newerct (older GNU find and find on BSD systems):
Create two timestamp files and use find to find all files that are newer than the oldest of these and older than the newest:
touch -d 2018-02-20T00:00:00 ts-start
touch -d 2018-03-03T00:00:00 ts-end
find . -type f -newer ts-start ! -newer ts-end ! -name ts-end -exec mv /destination ';'
rm -f ts-start ts-end
We have to exclude the ts-end filename as that file fulfills the criteria.
add a comment |Â
up vote
1
down vote
For find implementations that does not have -newerct (older GNU find and find on BSD systems):
Create two timestamp files and use find to find all files that are newer than the oldest of these and older than the newest:
touch -d 2018-02-20T00:00:00 ts-start
touch -d 2018-03-03T00:00:00 ts-end
find . -type f -newer ts-start ! -newer ts-end ! -name ts-end -exec mv /destination ';'
rm -f ts-start ts-end
We have to exclude the ts-end filename as that file fulfills the criteria.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
For find implementations that does not have -newerct (older GNU find and find on BSD systems):
Create two timestamp files and use find to find all files that are newer than the oldest of these and older than the newest:
touch -d 2018-02-20T00:00:00 ts-start
touch -d 2018-03-03T00:00:00 ts-end
find . -type f -newer ts-start ! -newer ts-end ! -name ts-end -exec mv /destination ';'
rm -f ts-start ts-end
We have to exclude the ts-end filename as that file fulfills the criteria.
For find implementations that does not have -newerct (older GNU find and find on BSD systems):
Create two timestamp files and use find to find all files that are newer than the oldest of these and older than the newest:
touch -d 2018-02-20T00:00:00 ts-start
touch -d 2018-03-03T00:00:00 ts-end
find . -type f -newer ts-start ! -newer ts-end ! -name ts-end -exec mv /destination ';'
rm -f ts-start ts-end
We have to exclude the ts-end filename as that file fulfills the criteria.
answered Mar 6 at 19:39
Kusalananda
103k13202318
103k13202318
add a comment |Â
add a comment |Â
up vote
0
down vote
find -newerct "20 Feb 2018" ! -newerct "2 Mar 2018" -exec mv /path/to/target/dir
This uses features introduced in recent versions of GNU find.
There are plenty of other ways to accomplish the same thing with find. See the man page for information about -newerxy, -mtime
and other goodies.
add a comment |Â
up vote
0
down vote
find -newerct "20 Feb 2018" ! -newerct "2 Mar 2018" -exec mv /path/to/target/dir
This uses features introduced in recent versions of GNU find.
There are plenty of other ways to accomplish the same thing with find. See the man page for information about -newerxy, -mtime
and other goodies.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
find -newerct "20 Feb 2018" ! -newerct "2 Mar 2018" -exec mv /path/to/target/dir
This uses features introduced in recent versions of GNU find.
There are plenty of other ways to accomplish the same thing with find. See the man page for information about -newerxy, -mtime
and other goodies.
find -newerct "20 Feb 2018" ! -newerct "2 Mar 2018" -exec mv /path/to/target/dir
This uses features introduced in recent versions of GNU find.
There are plenty of other ways to accomplish the same thing with find. See the man page for information about -newerxy, -mtime
and other goodies.
answered Mar 6 at 19:31
user1404316
2,314520
2,314520
add a comment |Â
add a comment |Â