Skip to content
  • Homepage
  • HTML
  • CSS
  • Symfony
  • PHP
  • How to
  • Contact
  • Donate

Teach Developer

Articles, Guides & Tips

How to Search Recently Modified Files in Linux

Home  »  How to • Linux   »   How to Search Recently Modified Files in Linux
Posted on September 3, 2022September 17, 2022
601

This post will help you to find recently modified files in Linux via the command line.

The find command works with, defining duration in Minutes or Days. The minutes are defined with -mmin and the day’s value can be defined with -mtime

You can also define the search criteria to find files modified within or before the specified duration. For example, to search files modified before, use “+” (positive) with duration (eg: +1, +24 etc). To search files modified within duration use “-” (negative) sign with duration value (eg: -1, -24) etc.

Modified within 10 Minutes:- Search all files modified within 10 minutes in the current directory. Use -mmin -10 means the files last modified for less than 10 minutes.

$ find . -type f -mmin -10

Modified within 2 Hours:- Find all files modified within 2 hours in the current directory. Use -mmin -120 means the files last modified less than 120 minutes ie equal to 2 hours.

$ find . -type f -mmin -120

Modified within 1 day:- Search all files modified within 24 hours in the current directory. To define range in days use -mtime. For example -mtime -1 means the files were last modified less than 24 hours ago.

$ find . -type f -mtime -1

Modified older than 10 Minutes:- Search all files modified before 10 minutes in the current directory. Use -mmin +10 option, which means finding all files modified more than 10 minutes ago.

$ find . -type f -mmin +10

Modified older than 2 Hours:- Find all files modified before 2 hours in the current directory. Use -mmin +120 options to search files modified older than 120 minutes (ie 2 hours).

$ find . -type f -mmin +120

Modified older than 1 day:- Search all files modified more than 24 hours ago in the current directory. You can use -mtime option to define duration in days. For example -mtime +1 means find all files modified before 24 hours.

$ find . -type f -mtime +1
How to, Linux

Post navigation

Previous Post: How to clear your cache in npm
Next Post: How to Display Breadcrumb without Plugin in WordPress

Related Posts

  • How to Delete Unused Database Tables in WordPress
  • Enable or Disable SSH Root Login Access in Linux
  • How to use events listeners and Event Subscriber in Symfony
  • How to change the link color of the current page with CSS?
  • How to fix getFullyear() is not a function with JavaScript?
  • How to check if a customer is logged in to Magento 2 or not?

Categories

  • Codeigniter (3)
  • CSS (11)
  • eCommerce (1)
  • Framework (1)
  • Git (3)
  • How to (43)
  • HTML (5)
  • JavaScript (15)
  • Jquery (7)
  • Laravel (1)
  • Linux (4)
  • Magento-2 (1)
  • Node js (4)
  • Others (2)
  • PHP (11)
  • React (13)
  • Server (1)
  • SSH (3)
  • Symfony (6)
  • Tips (16)
  • Top Tutorials (10)
  • Ubuntu (3)
  • Vue (1)
  • Wordpress (7)

Latest Posts

  • What is SSH in Linux?
  • How to Delete Files in Ubuntu Command Line
  • How to Deploy a React application on a cPanel
  • How to use events listeners and Event Subscriber in Symfony
  • How to Convert PHP CSV to JSON

WEEKLY TAGS

AJAX (1) Codeigniter (1) Javascript (11) JQuery (1) PHP (16) Programming (1) React (3) Symfony (1)

Random Post

How to Deploy a React application on a cPanel
How to change background Opacity when the bootstrap modal is open with CSS?
How to remove index.php from URL in CodeIgniter 4
How to make the div move up and down when scrolling the page with CSS?
ES6 classes

Quick Navigation

  • About
  • Contact
  • Privacy Policy

© Teach Developer 2021. All rights reserved