I need to know if we开发者_JS百科 have any command on UNIX such that: It gives me all the files which got updated after time t in the current directory
You can use find
with the mtime
parameter:
find . -maxdepth 1 -mtime -1h30m
You can use the find
command for this.
Touch a file with your specific date and then use that file with the -newer
parameter of find
.
# To find all files modifed on 10th of Dec:
touch -t 12100000 foo
# MMDDhhmm
find ./ -type f -maxdepth 1 -newer foo
Use the find
command with appropriate arguments. Relevant information is here.
#find files by modification time
-------------------------------
find . -mtime 1 # 24 hours
find . -mtime -7 # last 7 days
find . -mtime -7 -type f # just files
find . -mtime -7 -type d # just dirs
find with time: this works on mac os x
--------------------------------------
find / -newerct '1 minute ago' -print
精彩评论