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

The name of the pictureThe name of the pictureThe name of the pictureClash 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







share|improve this 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.


















    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







    share|improve this 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.
















      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







      share|improve this question















      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









      share|improve this question













      share|improve this question




      share|improve this question








      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.






















          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.






          share|improve this answer



























            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.






            share|improve this answer



























              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 6 at 19:39









                  Kusalananda

                  103k13202318




                  103k13202318






















                      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.






                      share|improve this answer
























                        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.






                        share|improve this answer






















                          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.






                          share|improve this answer












                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 6 at 19:31









                          user1404316

                          2,314520




                          2,314520












                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Bahrain

                              Postfix configuration issue with fips on centos 7; mailgun relay