vurid.blogg.se

C shell solaris find files by date
C shell solaris find files by date





c shell solaris find files by date

There is also an option called -daystart. $ find /home/you -iname "*.mp3" -atime 10 -type -f List all mp3s that were accessed exactly 10 days ago: $ find /home/you -iname "*.pdf" -atime -60 -type -f Following command will print the list of all pdf file that were accessed in last 60 days: You can also use access time to find out pdf files. $ find /home/you -iname "*.txt" -mtime -60 | wc -l $ find /home/you -iname "*.txt" -mtime -60 -exec cat \ Ĭount total number of files using wc command $ find /home/you -iname "*.txt" -mtime -60 -printĭisplay content of file on screen that were last modified 60 days ago, use So to find text files that were last modified 60 days ago, use

c shell solaris find files by date

-mtime 60 If you skip + or – it means exactly 60 days.-mtime +60 means you are looking for a file modified 60 days ago.For example to find file in last 2 months (60 days) you need to use -mtime +60 option. It returns list of file if the file was last accessed N*24 hours ago. You can search for files whose time stamps are within a certain age range, or compare them to other time stamps. Modify (change the file’s contents) – mtime change the status (modify the file or its attributes) – ctime

c shell solaris find files by date

Access (read the file’s contents) – atime I tried this also but it is sorting on file name not on modified date: find.

c shell solaris find files by date

type f -newermt " 00:00:00"Ģ) order the files on modified date ls -ltīut I am struggling to combine these two conditions. I want final output as a list of files with modified date after " 00:00:00" and in order by modified date.ġ) For getting files after certain modified date find. This is one of the part of my current shell script.Ĭondition contains two steps: 1) Fetch files from a directory after certain modified date.Ĭurrent directory contains files like this: Mar 28 11:14 file_H_1 I am trying to find all files after certain modified date from a directory in the sorting order of modified date using shell script.







C shell solaris find files by date