jeesshnasree
Flight Engineer
Flight Engineer
  • 413 Views

how to find files between 2 interval duration in linux

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

0 Kudos
1 Reply
S_Poulimenos
Mission Specialist
Mission Specialist
  • 38 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

0 Kudos
Join the discussion
You must log in to join this conversation.