![]() # find / -atime -1 Example 3: Find files which got changed exactly before 1 hour In the same way, following example finds all the files (under root file system /) that got accessed within the last 24 hours (1 day). -atime n File was last accessed n*24 hours agoįollowing example will find files in the current directory and sub-directories, which got accessed within last 1 hour (60 minutes) # find -amin -60.-amin n File was last accessed n minutes ago.Following is the definition of amin and atime from find man page. To find the files based up on the file access time, the option -amin, and -atime is used. # find / -mtime -1 Example 2: Find files which got accessed before 1 hour ![]() In the same way, following example finds all the files (under root file system /) that got updated within the last 24 hours (1 day). -mtime n File’s data was last modified n*24 hours ago.įollowing example will find files in the current directory and sub-directories, whose content got updated within last 1 hour (60 minutes) # find.-mmin n File’s data was last modified n minutes ago.Following is the definition of mmin and mtime from man page. To find the files based up on the content modification time, the option -mmin, and -mtime is used. To get more clarity refer the -atime section of the find command man page.Įxample 1: Find files whose content got updated within last 1 hour While doing the 24 hours calculation, the fractional parts are ignored so 25 hours is taken as 24 hours, and 47 hours is also taken as 24 hours, only 48 hours is taken as 48 hours.For example, time 2 = 2*24 hours (2 days). time argument treats its argument as 24 hours.For example, min 60 = 60 minutes (1 hour). min argument treats its argument as minutes.In the following examples, the difference between the min option and the time option is the argument. Change time gets updated when the inode data changes. Modification time gets updated when the file content modified. Access time gets updated when the file accessed. You can find files based on following three file time attribute. She was very happy to spot the sea lion in the California Long Beach Aquarium.įind Files Based on Access / Modification / Change Time Ramesh Natarajan: That is my sweet little daughter in that picture. In this article (Part 2), let us discuss 15 advanced examples of find command including - finding files based on the time it is accessed, modified or changed, finding files comparatively, performing operation on found files etc., Find command can do lot more than just searching for files based on name. A while back we reviewed 15 practical find command examples (Part I).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |