Active 10 years, 10 months ago. Viewed 19k times. Improve this question. Registered User Registered User 1, 5 5 gold badges 17 17 silver badges 35 35 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Use mmin instead of mtime which is only for hours.
See -mmin. Sign up or log in Sign up using Google. Sign up using Facebook. Your email address will not be published. This site uses Akismet to reduce spam.
Learn how your comment data is processed. Table of Contents Overview of find command in Linux. Find files modified in last 5 minutes in Linux. Find files modified in last 10 minutes in Linux. Find files modified in last N minutes in Linux.
Overview of find command in Linux The find command in Linux, provides an easy way to search files recursively in a directory hierarchy.
More details about the -nmin option of find command is as follows, Advertisements. Related Posts. Leave a Comment Cancel Reply Your email address will not be published. The above touch command will create a temp file whose timstamp is 40mins before. For example, if the time now is 10hours 50mins, the temp file timstamp will be 10hours 40mins.
If your Unix flavor does not have the "-d" option in the touch command, you can use the following method to set the timestamp:. This creates a temp file whose time stamp is ,Aug 21, 10hours 20mins.
Second, search files which are modified after this file temp has been modified. The below command will display all the files modified after the temp has been modified OR in other words find files which are newer than temp file:. Similarly, to find files which are modified before 40 mins. In other words to negate the above search, use the exclamation:.
One of the frequent requirement a sys admin gets is to find files modified before say last 2 days and 10 hours 30mins and move them to a backup directory.
It can be achieved by the below commands:.
0コメント