Last active
          September 6, 2019 06:57 
        
      - 
      
 - 
        
Save vladpurga/bd1c92004ea5c67da18b2509a9e22487 to your computer and use it in GitHub Desktop.  
    [find-mtime] #bash
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # create directories | |
| mkdir -p /tmp/test_day && cd $_ && mkdir -p today yesterday before_yesterday && cd - | |
| # in linux change modification time | |
| touch -d '-2 days' /tmp/test_day/before_yesterday | |
| touch -d '-1 day' /tmp/test_day/yesterday | |
| touch /tmp/test_day/today | |
| # find directories with modification time older then 24 hours | |
| find /tmp/test_day -mindepth 1 -mtime +0 | |
| # -and -a -or -o | |
| find /tmp/test_day -mindepth 1 -mtime -4 -a -mtime +1 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment