Need mtime with time stamp


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Need mtime with time stamp
# 1  
Old 11-11-2013
Need mtime with time stamp

hi all

Code:
find /folder1   -mtime 1  >folder1

with the above command , I can get the output of all the files which are modified(within folders and sub folders of folder1) in the last 24 hours.

but the listed files output , does not contain the time stamp with it.

I request you to give me the command , which can print the time stamp as well , in the mtime out put.

also , is this possible get the list of files which are modified between 14 to 18 hours previous to the present time.along with time stamp.

what should be the command for it.


Thanks in advance
# 2  
Old 11-11-2013
add -ls to your find statement

Code:
find ... -mtime 1 -ls > ...

# 3  
Old 11-11-2013
Is that what you're asking?

Code:
find /folder1 -mtime 1 -print0 | xargs -0 stat -c "%n %y" >folder1

# 4  
Old 11-11-2013
Please use code tags as required by forum rules!

find /folder1 -mtime 1 >folder1 will find files modified exactly 24 hours ago. For within last 24 hours, use -mtime -1.
Does your find have the mmin test? Use that for 14 - 18 hours find.
For your mtime stamp try
Code:
find /folder1   -mtime 1  -exec ls -lt {} + >folder1

(if your find versions allows for the + ).
# 5  
Old 11-12-2013
Very Thank you blackrageous and RudiC and all for the Response.
I used , find /folder -mtime -1 -ls > folder1 , I got what i wanted,
That is the number of files which are changed during last 24 hours , with
time stamp.

But I could not get , the command given by Aia , is this for the same purpose
Code:
find /folder1 -mtime 1 -print0 | xargs -0 stat -c "%n %y" >folder1

Regards

Last edited by Franklin52; 11-13-2013 at 03:13 AM.. Reason: Please use code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Time stamp Difference

I have a log file which wrote time stamp like this 2013-02-11 00:46:40.389037 2013-02-12 11:46:40.197045 can any one help me to get the time stamp difference of these two line in seconds. (4 Replies)
Discussion started by: netdbaind
4 Replies

2. Solaris

System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help here is what i get when i check for system date infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies

3. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

4. Shell Programming and Scripting

regarding time stamp

hi everyone i am facing a strange problem here suppose content of my file is a=1,2,3 b=2,3,4 c=4,5,6 time= now the problem is i want to add value in front of time variable and the value should be i format only "HHMMSS" so it should be like this a=1,2,3 b=2,3,4 c=4,5,6... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies

5. UNIX for Dummies Questions & Answers

How to get the next time stamp in perl?

Hi, I have to find the next time stamp in perl. Here is the code. @time = loaltime(time); print "\n Present time: $time:$time:$time \n"; For example if the time is: "12:55:02" after some process the time becomes 1:00:00. How do i check when it becomes 00:00 i.e from "12:55:02... (0 Replies)
Discussion started by: vanitham
0 Replies

6. Shell Programming and Scripting

Time stamp calculation

Hi all; I'm relatively new to scripting,I am working on a monitoring script.....where in i have to write subroutine which does the follows: It will check the time stamp of a file ( Oracle remarchive files) and compare it with existing time.If the time difference happen to be more than 90... (6 Replies)
Discussion started by: maverick_here
6 Replies

7. Shell Programming and Scripting

How to compare the mtime of a file with the current time?

Hi, I wondered if we could do this with shell script? How to compare the mtime of a file with the current time and check whether its less than 24 hours. Thanks.:b: (2 Replies)
Discussion started by: Krsh
2 Replies

8. UNIX for Dummies Questions & Answers

Date/Time Stamp

Hi All, Wondering if there is have a date added at the end of a test string. I have a hypothetical text file day one: John Paul George When the file day one is output, I'd like it to read something like this: John 101406 Paul 101406 George 101406 Day two, when the same text file... (0 Replies)
Discussion started by: JimmyFlip
0 Replies

9. Shell Programming and Scripting

greping with time stamp

Hi all, I want to grep a file name with time stamp as 30 minutes how can i??. Ex I will getting outputs in a file every minutes I want to grep it by a time intervals of 30 and show it . Any help will be great ! Thanks, Arun. (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

10. UNIX for Dummies Questions & Answers

capturing the time stamp

Hi All, I am working on a korn shell script. i have a file such as: DS.PETSCO.20060601203514.20060531.ctl_20060717124431 i have 2 problems here. 1) i have to capture the time stamp from the above file i.e this number 20060717124431. format of time stamp is YYYYMMDDHHMMSS. can... (4 Replies)
Discussion started by: pavan_test
4 Replies
Login or Register to Ask a Question