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
600

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 Get Environment Variables in Laravel ReactJS
  • How to make a div always float on the screen in the top right corner with CSS?
  • How to increase browser zoom level on page load 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?
  • How to Deploy or Host your ReactJS App in cPanel

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 Change SSH Port in Linux
How to Add Reset Button in jQuery UI Datepicker
How to Install a WordPress Plugin for Beginners
What is SSH in Linux?
10 Programming Habits that every Developer Should Adopt

Quick Navigation

  • About
  • Contact
  • Privacy Policy

© Teach Developer 2021. All rights reserved