Linux and UNIX like operating systems do not store file creation time. However, you can use file access and modification time and date to find out file by date.
ls Command Example
The syntax is as follows:ls -l | grep 'yyyy-mm-dd'Where,
ls -l | grep --color=auto '2006-01-05'
- 2006 - Year
- 01 - Month
- 05 - Day
ls -lu | grep --color=auto '2006-01-05'
find Command Example
If you need a specific date range many days ago, than consider using the find command. In this example find files modified between Jan/1/2007 and Jan/1/2008, in /data/images directory:touch --date "2007-01-01" /tmp/startYou can save list to a text file called output.txt as follows:
touch --date "2008-01-01" /tmp/end
find /data/images -type f -newer /tmp/start -not -newer /tmp/end
find /data/images -type f -newer /tmp/start -not -newer /tmp/end > output.txt
List ALL *.c File Accessed 30 Days Ago
Type the following commandfind /home/you -iname "*.c" -atime -30 -type -f
No comments:
Post a Comment