Pradeep
Pradeep

Reputation: 3468

Command help on UNIX

I need to know if we have any command on UNIX such that: It gives me all the files which got updated after time t in the current directory

Upvotes: 0

Views: 106

Answers (4)

Poo
Poo

Reputation: 213

#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

Upvotes: 1

codaddict
codaddict

Reputation: 455360

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

Upvotes: 2

Alastair
Alastair

Reputation: 470

You can use find with the mtime parameter:

find . -maxdepth 1 -mtime -1h30m

Upvotes: 3

darioo
darioo

Reputation: 47193

Use the find command with appropriate arguments. Relevant information is here.

Upvotes: 1

Related Questions