cancel
Showing results for 
Search instead for 
Did you mean: 
jeesshnasree
Starfighter Starfighter
Starfighter
  • 1,823 Views

how to find files between 2 interval duration in linux

Jump to solution

Hello All,

i have a doubt , 
how to find files between 2 interval duration in linux with one command

 

example / sample path:

File system: /opt/
1 . could you please help on this scnenario : list out files between ( from 5 minutes to 10 minutes ) ,
please share the coomand to check the files for between time duration . ( current day ) 

2 . could you please help on this scnenario : list out files between ( from 5 days to 10 days ) ,
please share the coomand to check the files for between days duration . 


could you please check & help on this .

i am waiting for your valuable help .

Regards ,

Jeesshnasree

1 Solution

Accepted Solutions
S_Poulimenos
Mission Specialist
Mission Specialist
  • 1,448 Views

Hello @jeesshnasree ,

1. find /path/to/directory -type f -mmin +5 -mmin -10

(to find files in a directory that were modified between 5 to 10 minutes ago)

2. find /path/to/directory -type f -mtime +5 -mtime -10 

(to find files in a directory that were modified between 5 to 10 days ago

Regards,

Spyros

View solution in original post

3 Replies
S_Poulimenos
Mission Specialist
Mission Specialist
  • 1,449 Views

Hello @jeesshnasree ,

1. find /path/to/directory -type f -mmin +5 -mmin -10

(to find files in a directory that were modified between 5 to 10 minutes ago)

2. find /path/to/directory -type f -mtime +5 -mtime -10 

(to find files in a directory that were modified between 5 to 10 days ago

Regards,

Spyros

jeesshnasree
Starfighter Starfighter
Starfighter
  • 1,214 Views

Hello @S_Poulimenos ,

 

Kudos ,thank you for valuable information 

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,198 Views

Hello @jeesshnasree !


A quick view of man page for find is highly recommended in case you need to know the super utility of find command :

https://man7.org/linux/man-pages/man1/find.1.html 

 

Tags (5)
0 Kudos
Join the discussion
You must log in to join this conversation.