Command to list new files in a directory

Linux would be more interesting once we get in deep. Share your linux knowledge and post your doubts regarding Linux OS

Command to list new files in a directory

Postby rekha on Tue Oct 13, 2009 6:13 pm

Hi,

Is there any command in linux to list recursively all the files in a directory updated after certain date.
rekha
Enthusiast
Enthusiast
 
Posts: 191
Joined: Sat Sep 22, 2007 1:39 pm


Re: Command to list new files in a directory

Postby Sanju on Tue Oct 13, 2009 7:48 pm

Hi,

To list todays files only:

Code: Select all
ls -al --time-style=+%D | grep `date +%D`


The parameters to the ls command here cause the datestamp to be output in a particular format. The cunning bit is that the output is then passed to grep. The grep parameter is itself a command , which substitutes the current date into the string to be matched.

You could easily modify it to search specifically for other dates, times, filesizes or whatever.
Sanju
Senior User
Senior User
 
Posts: 533
Joined: Wed Oct 31, 2007 5:09 pm


Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest