1835567 Members
2307 Online
110078 Solutions
New Discussion

list out file

 
SOLVED
Go to solution
peterchu
Super Advisor

list out file

I have some files in a directory , all files are generated at today , how to list out the files that generated after 13:00pm ? thx.
5 REPLIES 5
Stefan Farrelly
Honored Contributor
Solution

Re: list out file

ll -tr|grep -e "13:" -e "14:" -e "15:" -e "16:"

and so on up until the time you want to stop
Im from Palmerston North, New Zealand, but somehow ended up in London...
G. Vrijhoeven
Honored Contributor

Re: list out file

Hi,

Create a file using e.g. touch -t
Stefan Farrelly
Honored Contributor

Re: list out file

To be more precise, work out today (eg. Mar 2) and then do;

ll -tr|grep "Mar 2"|grep -e '[1][3-9]:' -e '[2][0-3]:'

This will list all files with todays date and from 13:00 to 19:59 and 20:00 to 23:59
Im from Palmerston North, New Zealand, but somehow ended up in London...
peterchu
Super Advisor

Re: list out file

thx all reply , i tried Stefan Farrelly's method is ok , but i have one more question , if I want copy all these files (generated after 13:00 ) to other directory, how can I do ? thx.
Mark Grant
Honored Contributor

Re: list out file

for i in `ll -tr | grep -e "13" -e "14"| awk '{ print $9 }'`
do
mv $i /other/directory
done
Never preceed any demonstration with anything more predictive than "watch this"