jonboy60.com – Linux, Tips, Tricks, Tutorial, Howto, News, Updates, Ideas, Blog, Magazine, Jonboy60, Open Source, Fedora, Ubuntu, OpenSuse, Linux Mint, CentOs

 


Find Files that modified today or certain time ago

0
Posted June 4, 2010 by jonboy60 in Command

How do I list all files created today or certain time ago using shell command under UNIX or Linux operating systems?

To find all files that was modified since a specific time ago in Unix environment, the find command will come in handy.

$ find . -mtime -1 -print
Flag -mtime -1 option tells find command to look for files modified in the last day (24 hours). Flag -print option will cause find command to print the files’ location. -print can be replaced with -ls if you want a directory-listing-type response.

$ find /directory_path -mtime -1 -print
The command is basically the same with the earlier command, you need to select the directory you want to search.

$ touch -t `date +%m%d0000` /tmp/$$
$ find /tmefndr/oravl01 -type f -newer /tmp/$$
The first command can be modified to specify other date and time, so that the commands will return all files that have changed since that particular date and time.

Good luck

~


0 Comments



Be the first to comment!


Leave a Response

(required)


5 − 5 =


CommentLuv badge