LinuxQuestions.org
Visit Jeremy's Blog.
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 02-09-2018, 06:51 PM   #1
BudiKusasi
Member
 
Registered: Apr 2017
Distribution: Artix
Posts: 345

Rep: Reputation: 15
How to find a file that's modified more than 2 days ago but less than 5 days


How to find a file that's modified more than 2 days ago but less than 5 days ago by use of any Linux utility ?
 
Old 02-09-2018, 07:25 PM   #2
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Use the find command

Code:
man find # excerpts of -mmin -mtime -type
       -mmin n
              File's data was last modified n minutes ago.
       -mtime n
              File's  data was last modified n*24 hours ago.  See the comments
              for -atime to understand how rounding affects the interpretation
              of file modification times.

       -type c
              File is of type c:

              b      block (buffered) special

              c      character (unbuffered) special

              d      directory

              p      named pipe (FIFO)

              f      regular file

              l      symbolic link; this is never true if the -L option or the
                     -follow option is in effect, unless the symbolic link  is
                     broken.  If you want to search for symbolic links when -L
                     is in effect, use -xtype.

              s      socket

              D      door (Solaris)
find operates left to right. If a result is valid for option X AND Y, it'll print it.
Because of this, if a result if valid for greater then 2 days AND less then 5 days, it should show up.

For example, find -iname \*py -iname m\* will find all files ending in py, then for those results, find files starting with m.
(You could also do m*py but misses the point)

Last edited by Sefyir; 02-09-2018 at 07:32 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
[SOLVED] How to find a file which is older than 5 days but youger than 6 days? thomas2004ch Linux - Software 1 10-29-2013 03:30 AM
How do I grep my /var/log/secure file for the past 7 days or so many days? johnmccarthy Linux - Newbie 5 01-04-2013 09:43 PM
How to Find and remove 7 days before modified/created files neel.gurjar Linux - Software 2 05-14-2008 08:17 PM
Passed CNE two days ago sundri Linux - Certification 1 10-17-2006 12:03 PM
remove a folder created 3 days ago. eduac Linux - Software 4 10-17-2005 11:15 AM

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

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