qertpure.blogg.se

Unix find file in subdirectories
Unix find file in subdirectories











unix find file in subdirectories

rw-r-r- 1 daygeek daygeek 418 Sep 8 03:54 remote-backup-1.sh rw-r-r- 1 daygeek daygeek 367 Sep 8 01:19 remote-backup-2.sh rw-r-r- 1 daygeek daygeek 436 Sep 8 01:04 remote-backup.sh rwxr-xr-x 1 daygeek daygeek 73 Aug 23 12:51 guna_server.sh rw-r-r- 1 daygeek daygeek 296 Aug 4 01:27 servicem.shĭrw-r-r- 3 daygeek daygeek 4.0K Aug 19 12:33 backup rw-r-r- 1 daygeek daygeek 361 Jul 29 19:45 service3a.sh rw-r-r- 1 daygeek daygeek 157 Jul 29 18:29 service1.sh rw-r-r- 1 daygeek daygeek 776 Jun 14 12:00 memory-monitor.sh rw-r-r- 1 daygeek daygeek 830 Jun 14 11:54 process.sh rw-r-r- 1 daygeek daygeek 616 Jun 2 13:25 cpu-alert2.sh This can be done by using the ls command with some options as shown below, which sorts the files and folders in reverse order based on the conversion time. -mtime 10: Use this format to find all files that were modified EXACTLY 10 days ago.ġ) Sorting files & folders based on conversion time.-mtime -10: It will find all files that were modified in the last 10 days.-mtime +10: This will find all files that were modified 10 days ago.See the format below for a better understanding. Use “-mtime n” command to return a list of files that were last modified “ n” hours ago. We can use numerical arguments with ‘mtime’. The common syntax is as follows: stat # stat /home/daygeek/shell-script/remote-backup.shįile: /home/daygeek/shell-script/remote-backup.sh It can be easily seen using ‘stat’ command, which displays all three timestamps of a file. ctime/cmin: The last time the file’s attribute was modified.mtime/mmin: The last time the file’s contents was modified.atime/amin: The last time the file was accessed by some command or application.Read the below explanation for better understanding about timestamp. mtime: modify time or Last modification time.In Linux, a file contains three timestamps, which are updated when a file is accessed or modified or replaced. In this article, we have included 13 examples for locating files based on timestamp and I hope this article will meet your needs.

unix find file in subdirectories

#Unix find file in subdirectories how to#

Please refer to our previous article on how to find a directory size in Linux. The find command is used to search or locate files based on various criteria such as timestamp, file type and file permissions in Linux. If you are working on thousands of files a day and want to find a list of files that have been modified recently in a directory for certain purposes, this can be done easily using the find command.













Unix find file in subdirectories