The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to get 4 Hrs back time and compare with successive time maanik85 UNIX for Dummies Questions & Answers 2 07-15-2008 09:48 AM
Compare file time pdr302 Shell Programming and Scripting 1 11-01-2007 07:14 PM
Compare Date And Time Jamil Qadir UNIX for Dummies Questions & Answers 5 01-10-2007 11:22 AM
compare update time of files dorilevy UNIX for Dummies Questions & Answers 8 05-27-2003 10:48 AM
compare files acess time AkumaTay UNIX for Dummies Questions & Answers 2 05-19-2002 04:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-04-2008
sparks sparks is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 30
Question Can we compare time ...

Hi ...

Is there a possibility that timings from two files be compared??

If i have a set of files in a folder and i want to get the files only upto a particular time.
eg:
If i have the files

staff 2388 Oct 3 04:33 x.ksh
staff 3628 Oct 3 06:57 1.ksh
staff 32383 Oct 3 06:57 files
staff 280365 Oct 3 06:57 bakup
staff 140770 Oct 3 20:54 satsub1
staff 123000 Oct 3 20:58 satsub2

I want the list of files which are present before or equal to time 20:54

Is that possible with time???

thanks,
  #2 (permalink)  
Old 10-04-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,789

Code:
touch -t 200810032054 dummy
find /path/to/files -type f ! -newer dummy -exec ls -l {} \;
rm -f dummy

put a timestamp on a dummy file, use that file with ! -newer - meaning "not" newer or older in a find command. If you have a file already has the correct timestamp you do not need to touch a dummy file
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0